-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Modify Custom Plugin code cause unexpected 504 #14440
Comments
I can't reproduce this. It's running fine for me. The server seems to be restarting and perhaps the page fetched too eagerly that the server isn't ready yet? Does this also happen if you press the |
@bluwy Did you try commenting out the console statements multiple times and then checking the page? It's possible that the issue may not occur in once change. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
video 2023-10-08.14.30.46.mov |
Thanks. Strangely I can reproduce it now with that exact steps. |
This is fixed by: See new docs at: https://main.vitejs.dev/guide/ssr.html#setting-up-the-dev-server We need to use the new versions of Vite middlewares after a restart: app.use((req, res, next) => {
vite.middlewares.handle(req, res, next)
}) instead of app.use(vite.middlewares) |
Describe the bug
I am writing a custom Vite plugin to handle routing.
The plugin works fine, but when I comment out or add console statements in the load function, a 504 error is displayed on the webpage.
Reproduction
https://github.com/childrentime/vite-react-test
Steps to reproduce
Use npm run dev to start the app.
Visit http://localhost:5173/a route.
And go ./vitePlugns/pluginRoutes.js file, search FIXME word.
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: