-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
The error middleware requires JS to display anything:
| import { ErrorOverlay } from '/@vite/client' |
But sometimes you have an error that prevents the JS from loading:
In these cases you just get a blank page
Reproduction
n/a
Steps to reproduce
The error handler does not work with regular middlewares:
vite.middlewares.use((req, res, next) => {
throw new Error('hello world');
});
It only works with post middlewares:
return () => {
vite.middlewares.use((req, res) => {
throw new Error('hello world');
});
};
https://vitejs.dev/guide/api-plugin#configureserver
System Info
vite 5.2.8Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
