You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Bug report
Describe the bug
I get the following error when trying to start my Next.js application in my production environment (AWS EBS):
TypeError: Cannot read property 'filter' of undefined at NextScript.getPolyfillScripts (/var/app/current/.next/server/static/8HSfigb_BmRkaQMwJTl6H/pages/_document.js:735:26) at NextScript.render (/var/app/current/.next/server/static/8HSfigb_BmRkaQMwJTl6H/pages/_document.js:836:75) at d (/var/app/current/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:38:231) at $a (/var/app/current/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16) a.b.render (/var/app/current/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:476) a.b.read (/var/app/current/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:18) renderToStaticMarkup (/var/app/current/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:54:462) renderDocument (/var/app/current/node_modules/next/dist/next-server/server/render.js:3:624) renderToHTML (/var/app/current/node_modules/next/dist/next-server/server/render.js:50:72) processTicksAndRejections (internal/process/task_queues.js:97:5)
The AWS EBS environment runs Node.js 12 on a 64bit Amazon Linux 2/5.2.0. I've deployed another app in a similar environment without any issues using v9.4.0 of Next.
To Reproduce
I build the app, zip it up, deploy it to AWS EBS and run npm start on port 8080.
Expected behavior
Expected behaviour is that the app starts without any internal server errors.
Screenshots
Stacktrace from my AWS environment:
System information
The AWS EBS environment runs Node.js 12 on a 64bit Amazon Linux 2/5.2.0. I use 9.4.0 of Next.
I changed the version of my production environment such that it is the same as my build environment. However, I experience some quite weird behaviour. When I start the app without specifying a port (i.e. port 3000), I don't get any error. However, when adding -p $PORT, I get the above error.
Any idea why this might happen?