Replies: 2 comments
-
Evan You was kind enough to share his thoughts on Twitter - will likely be best to pass on any request with a |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think we could add a query param check here: https://github.com/vercel/vercel/blob/main/packages/cli/src/util/dev/server.ts#L1780 UPDATE: Nope, it's here:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently,
vercel dev
is broken for Vite users.There are some small issues with port mapping and
rewrite
disables that were easy enough to work around, but I've identified one issue I can not solve. It seems as though vite's non-JS imports in dev request javascript as the response type (maybe for hot reloading?), andvercel dev
does not support it.Example: When using an imported SVG in
vite
dev, two fetches occur:The first one is a valid JS file
http://localhost:3000/src/assets/TwitchGlitchPurple.svg?import
, which contains the following:This JS file has the path to the asset, which is fetched after.
When using
vercel dev
, only one fetch occurs, which directly returns the asset:It seems like Vite interally uses a
?import
query param to override asset paths with a JS shim as seen above.Console error of import type mismatch:
Not sure what the best path forward here is. My best guess is that
vercel dev
tries to serve static assets itself, ignoring query params. Perhaps query params should break the match and try to pass the request on to the frontend framework? 🤔Related: #6145
Beta Was this translation helpful? Give feedback.
All reactions