Hi,
I deploy my Next.js 14.x app from GitHub. According to the build log (and my understanding) I only have static rendered routes. During the build I access the file system using Nodes fs
module to generate static routes with content from my repository. That works both locally on my machine and on Netlify.
Upgrading to Next.js (from 14.0 to latest 14.2.3 version), my app now failes at runtime (" This function has crashed" from the Next.js Server Handler function) .
It seems that after the upgrade, the NetlifyCacheHandler
executes the generateStaticParams
in my page.tsx
files. That generateStaticParams
function fails because in the deployed version the folder with the static content (content
) is not available at runtime.
Apr 26, 01:12:57 PM: cc243690 DEBUG [NetlifyCacheHandler.get]: /index
Apr 26, 01:12:57 PM: cc243690 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, scandir 'content'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, scandir 'content'","code":"ENOENT","errno":-2,"syscall":"scandir","path":"content","stack":["Error: ENOENT: no such file or directory, scandir 'content'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, scandir 'content'"," at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:529:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Is there any way to disable the execution of NetlifyCacheHandler.get
or any other way to make my application’s static routes work with Next.js 14.2? Thanks!
Failing deployment using Next.js 14.2.3: https://663caf1ea89dd900080096b4--nilshartmann-net.netlify.app/
Same source code, but with Next.js 14.0: https://663cb09a4c823b00089a34d1--nilshartmann-net.netlify.app/