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:
Does anyone know how to resolve this?
10 Replies
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
Thanks @Erisa - its neither a static nor next-on-pages site. Just a normal Cloudflare pages site. There is no error on the page.
Can you check "Assets uploaded" under the deployment details then?
I see the following:
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
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.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
Why would using a
server.js
file imply it would be long running?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 PagesYou 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