Error rendering error pages: TypeError: mountedInstances.slice is not a function
See original GitHub issueBug report
Describe the bug
On try to open a page that not exist (like: /asd), I get a server error when next try to render the _error page. I not have custom _page or _document and I using the next versions 9.1.5. the error not happen in version 9.0.5. I’m using micro custom server configured in a similar way that is in example but running it with typescript.
TypeError: mountedInstances.slice is not a function
at emitChange (/Users/project/.next/server/static/development/pages/_error.js:2371:73)
at new class_1 (/Users/project/.next/server/static/development/pages/_error.js:2392:9)
at processChild (/Users/project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3159:14)
at resolve (/Users/project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3124:5)
at ReactDOMServerRenderer.render (/Users/project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3598:22)
at ReactDOMServerRenderer.read (/Users/project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3536:29)
at renderToString (/Users/project/node_modules/react-dom/cjs/react-dom-server.node.development.js:4245:27)
at render (/Users/project/node_modules/next/dist/next-server/server/render.js:82:16)
at Object.renderPage (/Users/project/node_modules/next/dist/next-server/server/render.js:323:20)
at /Users/project/.next/server/static/development/pages/_document.js:4356:21
at step (/Users/project/.next/server/static/development/pages/_document.js:45:23)
at Object.next (/Users/project/.next/server/static/development/pages/_document.js:26:53)
at asyncGeneratorStep (/Users/project/.next/server/static/development/pages/_document.js:239:24)
at _next (/Users/project/.next/server/static/development/pages/_document.js:261:9)
at /Users/project/.next/server/static/development/pages/_document.js:268:7
at new Promise (<anonymous>)
To Reproduce
install the lattes next version and try to navigate to a page that not exist like /asd
server will show Internal Server Error
and console log will show the log previously explained.
Expected behavior
To show the normal 404 error page.
System information
- OS: macOS
- Version of Next.js: 9.1.5
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error rendering error pages: TypeError: mountedInstances ...
Bug report Describe the bug On try to open a page that not exist (like: /asd), I get a server error when next...
Read more >Meteor error on fast-rendering path TypeError: dynamics.slice ...
I'm not sure where the source of the problem is, so I'm not sure which parts of the code to share. The route...
Read more >TypeError: slice is not a function in JavaScript | bobbyhadz
The "slice is not a function" error occurs when the slice() method is called on a value that is not of type string...
Read more >Fix - slice is not a function error in JavaScript - Reactgo
slice () method on a value which is not a type string or array, we will get the following error in our console....
Read more >typeerror: this.items.slice is not a function - You.com - You.com
Coding example for the question Laravel + Vuetify error: Error in render: this.items.slice is not a function" & Invalid prop: Expected Array, ......
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 Free
Top 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
I finally solve this by mi self changing
tsconfig.server.json
file adding this fields:"lib": ["es2017"], "target": "es2017",
I could understand the relation between my server files compilation and next 404 pages compilation.This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.