The Cachier
CDCloudflare Developers
•Created by The Cachier on 12/18/2023 in #workers-help
next-on-pages build gives "Internal Server Error" on yarn pages:dev
Hi!
We have a NextJS app and trying to deploy to Cloudflare. On the yarn pages:build step, the following warnings/messages are displayed:
% yarn pages:build
yarn run v1.22.1
$ npx @cloudflare/next-on-pages
⚡️ @cloudflare/next-on-pages CLI v.1.8.2
⚡️ Detected Package Manager: yarn (1.22.1)
⚡️ Preparing project...
⚡️ Project is ready
⚡️ Building project...
▲ Vercel CLI 32.7.2
..
▲ Detected Next.js version: 14.0.4
..
..
[webpack.cache.PackFileCacheStrategy] Serializing big strings (109kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
..
[webpack.cache.PackFileCacheStrategy] Serializing big strings (112kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
▲ ⚠ Compiled with warnings
./node_modules/scheduler/cjs/scheduler.production.min.js
▲ A Node.js API is used (MessageChannel at line: 120) which is not supported in the Edge Runtime.
..
./node_modules/scheduler/cjs/scheduler.production.min.js
▲ A Node.js API is used (setImmediate at line: 51) which is not supported in the Edge Runtime.
The build completes successfully.
The dependency of Scheduler looks like this:
$ npm ls scheduler
<the-app>
└─┬ [email protected]
└── [email protected]
So this is an npm module used by standard react-dom.
Running with yarn pages:dev and launching localhost shows this only message in the browser:
Internal Server Error
And on the command-line this can be seen:
✘ [ERROR] ⨯ TypeError: (w.adapter || b.adapter) is not a function
wrangler:inf] GET / 500 Internal Server Error (178ms)
Not much to go on. There are references to generated files, like:
.../.vercel/output/static/_worker.js/next-on-pages-dist/webpack/86d03c243df5247d6f6729bd979a6117.js:62:138483)
But we assume this is related to the warnings/messages seen while building the application.
Has anyone seen something similar?
We appreciate hint and tips, as there seem to be little information available.
Kind regards,
/Peter
4 replies