You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem seems to be that the leading / from the url is included when resolving.
I managed to fix the issue by doing a quick and dirty patch to resolveId() that removes the leading slash if rawId starts with /@vitereprod. Everything works as expected after this change, including hot reloading. No clue how to generalize it though 🤷♀️
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.
Describe the bug
I'm trying to use vite in a monorepo where i have some packages that need to be imported in
<head>
(that shouldnt be bundled in my main app ts file):Building works perfectly as expected, but not when using the dev server (just running
npx vite
).It correctly resolves the package during initial boot-up
But resolution fails when loaded via HTTP
The problem seems to be that the leading
/
from the url is included when resolving.I managed to fix the issue by doing a quick and dirty patch to resolveId() that removes the leading slash if
rawId
starts with/@vitereprod
. Everything works as expected after this change, including hot reloading. No clue how to generalize it though 🤷♀️First time using Vite so this might just be a deep misunderstanding of how to do this and i just managed to find a way to force this behavior :p
Reproduction
https://github.com/hex2f/vite-bug-reprod
Steps to reproduce
try to open the dev server in browser or curl
http://localhost:port/@vitereprod/foo/src/index.ts
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: