We’re currently migrating from vercel to netlify. So far all projects work without much problems, save for one: https://codecosmos-website.netlify.app/
The problem seems to be with the Next.js SSR handler. When i look at the logs i see the following:
Jan 14, 02:31:42 PM: aacd142e ERROR 2026-01-14T13:31:43.334Z undefined ERROR Uncaught Exception {“errorType”:“TypeError”,“errorMessage”:“Cannot convert undefined or null to object”,“stack”:[“TypeError: Cannot convert undefined or null to object”," at Function.entries ()“,” at /var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:56:39"," at Object. (/var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:174:3)“,” at Module._compile (node:internal/modules/cjs/loader:1521:14)“,” at Module._extensions..js (node:internal/modules/cjs/loader:1623:10)“,” at Module.load (node:internal/modules/cjs/loader:1266:32)“,” at Module._load (node:internal/modules/cjs/loader:1091:12)“,” at Module.require (node:internal/modules/cjs/loader:1289:19)“,” at require (node:internal/modules/helpers:182:18)“,” at Object. (/var/task/___netlify-handler.js:1:18)"]}
Jan 14, 02:31:42 PM: aacd142e ERROR INIT_REPORT Init Duration: 525.45 ms Phase: init Status: error Error Type: Runtime.Unknown
Jan 14, 02:31:42 PM: aacd142e ERROR 2026-01-14T13:31:43.795Z undefined ERROR Uncaught Exception {“errorType”:“TypeError”,“errorMessage”:“Cannot convert undefined or null to object”,“stack”:[“TypeError: Cannot convert undefined or null to object”," at Function.entries ()“,” at /var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:56:39"," at Object. (/var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:174:3)“,” at Module._compile (node:internal/modules/cjs/loader:1521:14)“,” at Module._extensions..js (node:internal/modules/cjs/loader:1623:10)“,” at Module.load (node:internal/modules/cjs/loader:1266:32)“,” at Module._load (node:internal/modules/cjs/loader:1091:12)“,” at Module.require (node:internal/modules/cjs/loader:1289:19)“,” at require (node:internal/modules/helpers:182:18)“,” at Object. (/var/task/___netlify-handler.js:1:18)"]}
Jan 14, 02:31:42 PM: aacd142e ERROR INIT_REPORT Init Duration: 444.57 ms Phase: invoke Status: error Error Type: Runtime.Unknown
Jan 14, 02:31:43 PM: aacd142e Duration: 925.84 ms Memory Usage: 101 MB Status: error Error Type: Runtime.Unknown
I’ve tried several things to resolve this, inlcuding installing the netlify cli, the netlify ai agent and searching these forums/docs & on google.
- i linked my local directory to the netlify project.
- When i build locally with npm run build all goes well.
- When i run netlify dev all goes well and the site loads perfectly. But http://localhost:8888/.netlify/functions/___netlify-handler gives me a “function not found…”.
I can’t find how to debug this. Logically i would think that after linking the project, the netlify Nextjs handler function would be available locally, but it isn’t. So running netlify-dev doesn’t give me any more info on what object is null. I’ve tried adjusting likely suspects, but to no avail.
The docs don’t help me. They speak about a toml file. But nothing on how to import a function to my local environment, or how to import a configuration from netlify to my local environment so i can debug.
So after searching: HELP! How can i get to the root of the issue?
- Build problems? Link or paste the FULL build log & build settings screensho
