-
-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 Error Page not working #378
Comments
Thanks for reporting! I suspect this started happening since the introduction of https://nextjs.org/docs/advanced-features/custom-error-page#404-page. If that's the case, this would need to be supported in serverless-next.js, probably changing this. If someone can confirm and is happy to PR I'll happily accept contrib. 👍 |
This may be related... |
I believe that the issue is because of #11561 On line 283 of next-serverless-loader.ts,
If I understand correctly, |
Good catch. |
Is there any workaround (to implement in app) without waiting for new package version? |
So I quite literally did what @danielcondemarin suggested in his previous comment and the 404 status is now being returned correctly. I have not noticed any regressions with the change. However, it is being rendered in the _error template instead of the 404 one. I assume this has never worked for this project before and will require a custom implementation. Commit here: lone-cloud@834886a You can test it by cloning the set_status_undefined/378 branch, run |
Update next-aws-lambda to latest version. This fixes two issues: - serverless-nextjs/serverless-next.js#436 - serverless-nextjs/serverless-next.js#378
Describe the bug
When using
next@9.3.5
, navigating to an invalid URL does not show the 404 error page. Instead, you see 200 | An unexpected error has occurred.To Reproduce
Steps to reproduce the behavior:
npx serverless
to deployExpected behavior
Should see a 404 | Page Not Found error.
Screenshots
Desktop (please complete the following information):
Additional context
When using
next@9.3.4
, the 404 page works as expected.The text was updated successfully, but these errors were encountered: