-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use req.originalUrl
for better Vite compatibility
#7343
Conversation
🦋 Changeset detectedLatest commit: 8c1257c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Could we do something like |
Yeah, that works too and is even easier. Done. |
Was there something else with |
I don't think we'd have to do it in
|
This gets us pretty darn close to being able to set the
base
option in Vite correctly. Right now we hardcode it to./
, which isn't correct and I suspect is one of the reasons the highly upvoted #2958 doesn't work. There's one more thing we'll need to fix it which is vitejs/vite#9236 and I'm working on getting that in as part of Vite 4The reason we need this is that Vite rewrites the
url
to strip out the base path, which makes theurl
not what we might expect. I looked into changing that in Vite and discussed with the Vite team. While there's the possibility we might be able to do it, it's not easy and would affect the entire Vite ecosystem, so we'd need to get buy in from all the other frameworks. And actually, what Vite is doing is how the Express ecosystem works and is explicitly whatoriginalUrl
was provided for, so there's a good argument they shouldn't change anything on their side