Next.js app redirects to error page on load -getInitialProps() #15701
Replies: 4 comments
-
Do you happen to have a repository with a code sample you could share? |
Beta Was this translation helpful? Give feedback.
-
I don't, but it's a problem with the node modules dependencies. I deployed using the node modules from a previous project (2 weeks old approximately) and it solved the problem. |
Beta Was this translation helpful? Give feedback.
-
This might help. Our dependencies: |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue. Bump! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Next.js v: 9.1.6
React: 16.12.0
Deployment environment: Amazon Cloudfront
The issue started yesterday. On page load (using getInitialProps()), the index page would display error "200. An unexpected error has occurred." When I go to a different page and then back to the index page, it renders the page normally (a server-side vs client side rendering issue perhaps?)
The same issue was observed again in a different app, where on load it redirects to /_error.
No reason whatsoever for these errors. I have used the same code as a template dozens of times to deploy micro web applications with no issues. Nothing has changed since the last successful deployment. Also, no errors in the console or red flags in the Networks tab of devTools.
Please note that this happens only when deployed. When running locally there are no issues whatsoever.
Beta Was this translation helpful? Give feedback.
All reactions