Internal Server Error - TypeError: lowPriorityScripts is not iterable
See original GitHub issueBug report
Describe the bug
I have a very basic Next.js App setup, and everything works just perfectly on development. But as soon as I build the app and deploy to the server, it doesn’t render the default 404 page, but instead shows:
Internal server error
To Reproduce
- Build the next app, using “next build”
- Deploy it to ubuntu server (Nginx)
- Run the app using “next start -p 8000”
- Go to a random route that doesn’t exist (e.g. /xyz)
What is working
The development and even production build if served via “next start” on my mac.
Expected behavior
The default 404 page should be rendered, instead of the error “Internal server error”.
Error Log
TypeError: lowPriorityScripts is not iterable
at NextScript.getScripts (/home/ubuntu/app/.next/server/static/-w_wsy_dLbzAUuf_h5xwp/pages/_document.js:824:34)
at NextScript.render (/home/ubuntu/app/.next/server/static/-w_wsy_dLbzAUuf_h5xwp/pages/_document.js:948:182)
at processChild (/home/ubuntu/app/node_modules/react-dom/cjs/react-dom-server.node.development.js:3293:18)
at resolve (/home/ubuntu/app/node_modules/react-dom/cjs/react-dom-server.node.development.js:3124:5)
at ReactDOMServerRenderer.render (/home/ubuntu/app/node_modules/react-dom/cjs/react-dom-server.node.development.js:3598:22)
at ReactDOMServerRenderer.read (/home/ubuntu/app/node_modules/react-dom/cjs/react-dom-server.node.development.js:3536:29)
at Object.renderToStaticMarkup (/home/ubuntu/app/node_modules/react-dom/cjs/react-dom-server.node.development.js:4261:27)
at renderDocument (/home/ubuntu/app/node_modules/next/dist/next-server/server/render.js:91:18)
at Object.renderToHTML (/home/ubuntu/app/node_modules/next/dist/next-server/server/render.js:369:16)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Server information
- OS: Ubuntu
- Browser: Chrome
- Version of Next.js: [e.g. 9.1.7]
Additional Information
I have a customized _document.js
if that can cause some issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Internal Server Error - TypeError: lowPriorityScripts is not iterable
I am facing the same issue while deployment. TypeError: lowPriorityScripts is not iterable. This build is working fine in local environment but ...
Read more >TypeError: 'x' is not iterable - JavaScript - MDN Web Docs
The JavaScript exception "is not iterable" occurs when the value which is given as the right-hand side of for...of, as argument of a...
Read more >Int Object is Not Iterable – Python Error [Solved]
If you are running your Python code and you see the error “TypeError: 'int' object is not iterable”, it means you are trying...
Read more >"TypeError: object is not iterable (cannot read property Symbol ...
I am making controlled components in React and I am using states and seting states in forms. But this error occurs ...
Read more >CAPM: undefined is not iterable - SAP Community
However, I am getting error in cds watch logs that 'TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re likely not copying your
package-lock.json
oryarn.lock
to your production server before dependency install, causing a Next.js version mismatch.When I was on Next.js v9.1, I was able to do the equivalent of the following:
to reduce the size of my production Docker image. Upgrading to Next.js >= 9.2, I’m getting the above error.
Is there a solution to this that doesn’t involve including all my dev dependencies on production? I really don’t want to pay for storage space to hold my storybook, unit testing, and linting dependencies that aren’t used in production.