Skip to content
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

Top level error thrown in pages/_app causes app to render internal server error #24070

Closed
timneutkens opened this issue Apr 14, 2021 · 1 comment · Fixed by #24079
Closed
Milestone

Comments

@timneutkens
Copy link
Member

What version of Next.js are you using?

next@canary

What version of Node.js are you using?

latest

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Does not affect this bug

Describe the Bug

When a top-level error is thrown in pages/_app.js the internal server error case is hit.

Expected Behavior

The error should be rendered.

To Reproduce

A reproduction is provided in this failing test PR: #24069

@timneutkens timneutkens added this to the Iteration 19 milestone Apr 14, 2021
@kodiakhq kodiakhq bot closed this as completed in #24079 Apr 15, 2021
kodiakhq bot pushed a commit that referenced this issue Apr 15, 2021
This fixes an internal server error showing when a top-level error occurs in `_app` in development instead of the dev overlay. This includes the failing test case from #24069 and also ensures the overlay is cleared when the error is corrected. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

Fixes: #24070
Closes: #24069
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this issue Apr 20, 2021
…#24079)

This fixes an internal server error showing when a top-level error occurs in `_app` in development instead of the dev overlay. This includes the failing test case from vercel#24069 and also ensures the overlay is cleared when the error is corrected. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

Fixes: vercel#24070
Closes: vercel#24069
kodiakhq bot pushed a commit that referenced this issue Apr 22, 2021
This expands on #24070 and ensures we show the dev overlay for additional cases like where `_app` or `_document` have syntax errors causing compilation to not be able to complete. This achieves showing the dev overlay even when compilation fails from a syntax error by doing a third minimal compilation in development with the needed client-side assets to render the dev overlay. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

x-ref: #24070
@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants