workers.api.error.script_not_found [code: 8000068]

Hello I have two Next js web applications, that, after some experimenting, builds and deploys. However nothing displays in the browser. And when tailing the logs in both, I see the same:
workers.api.error.script_not_found [code: 8000068]
workers.api.error.script_not_found [code: 8000068]
Does anyone know how to resolve this?
10 Replies
Erisa
Erisa4mo ago
That error is expected from log tail if the site is static - are you using static export or next-on-pages? If using static export and you're just getting a blank page, check the "Assets uploaded" tab on deployment details because chances are something is wrong there If the page has an actual error, feel free to share that error
Magick
Magick4mo ago
Thanks @Erisa - its neither a static nor next-on-pages site. Just a normal Cloudflare pages site. There is no error on the page.
Erisa
Erisa4mo ago
Can you check "Assets uploaded" under the deployment details then?
Magick
Magick4mo ago
I see the following:
File name
BUILD_ID
app-build-manifest.json
app-path-routes-manifest.json
build-manifest.json
package.json
prerender-manifest.js
prerender-manifest.json
react-loadable-manifest.json
required-server-files.json
routes-manifest.json
server
app-paths-manifest.json
font-manifest.json
middleware-build-manifest.js
middleware-manifest.json
middleware-react-loadable-manifest.js
next-font-manifest.js
next-font-manifest.json
pages-manifest.json
server-reference-manifest.js
server-reference-manifest.json
webpack-api-runtime.js
webpack-runtime.js
app
chunks
pages
[[...publicId]].js
[[...publicId]].js.nft.json
_app.js
_app.js.nft.json
_document.js
_document.js.nft.json
_error.js
_error.js.nft.json
api
old
File name
BUILD_ID
app-build-manifest.json
app-path-routes-manifest.json
build-manifest.json
package.json
prerender-manifest.js
prerender-manifest.json
react-loadable-manifest.json
required-server-files.json
routes-manifest.json
server
app-paths-manifest.json
font-manifest.json
middleware-build-manifest.js
middleware-manifest.json
middleware-react-loadable-manifest.js
next-font-manifest.js
next-font-manifest.json
pages-manifest.json
server-reference-manifest.js
server-reference-manifest.json
webpack-api-runtime.js
webpack-runtime.js
app
chunks
pages
[[...publicId]].js
[[...publicId]].js.nft.json
_app.js
_app.js.nft.json
_document.js
_document.js.nft.json
_error.js
_error.js.nft.json
api
old
Erisa
Erisa4mo ago
There's no index.html, so it would be expected that the index returns a blank page. This would either be the output directory configured wrong, or the build process not building the site in the expected way
Magick
Magick4mo ago
Even when I build and run locally there is no index.html. I've modified the next.config.mjs and now it produces a server.js file, but still no index.html. I'm assuming the server file creates it dynamically.
Erisa
Erisa4mo ago
Pages can't run long-running node.js processes, if you want a nextjs site to be rendered dynamically on Pages you have to use next-on-pages
Magick
Magick4mo ago
Why would using a server.js file imply it would be long running?
Erisa
Erisa4mo ago
Because thats the file Next.js outputs when configured to work with a Node.js environment The idea is that you run node server.js and it runs your website on a local http server which for that, is great, but it won't work for Pages
Erisa
Erisa4mo ago
You need to use https://github.com/cloudflare/next-on-pages to get dynamic Next.js working on Pages, this will output in a format compatible with Pages
GitHub
GitHub - cloudflare/next-on-pages: CLI to build and develop Next.js...
CLI to build and develop Next.js apps for Cloudflare Pages - cloudflare/next-on-pages
Want results from more Discord servers?
Add your server