Files
Jiachi LiuandGitHub 303585a94e Display global-error along dev overlay during development (#75101)
### What

Display `global-error.js` along with error overlay in development. When
a runtime error occurred, you should be able to view the
`global-error.js` content by just hiding the error overlay.


### Why

Current behavior of `global-error.js` confused a lot of users that it
only renders in production build, howerver in dev it's always shows the
error overlay. This was considered "expected" before as you should focus
on fixing error in dev. But this brings a lot of inconvenience for
users, since they can't view the `global-error.js` easily in development
but production build.


#### After
The global-error content is displayed in the html with error overlay
covered

![image](https://github.com/user-attachments/assets/58fd73f8-7634-4a52-b6f8-c912cbb36fc3)

#### Before
Notice nothing displayed

![image](https://github.com/user-attachments/assets/319f3eb0-5d30-4c51-8e29-872aaec42261)


Fixes #55462
Fixes #52993
Closes NDX-694
2025-01-20 16:39:08 +01:00

6 lines
100 B
JavaScript

export default function layout() {
throw new Error('layout error')
}
export const revalidate = 0