-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
vite subpath imports not working with query (e.g #bar.css?inline
)
#13182
Comments
Start a new pull request in StackBlitz Codeflow. |
The import style from '#bar.css'; // <-- should have ?inline Ideally this should be imported as As a workaround, you could set a regex in |
Thanks @bluwy ! |
Why are you adding the imports as a But the reproduction still fails during build if that is removed, so it looks like a Vite issue I think we should have restrained from using |
@patak-dev Initially I thought it is an issue that subpath imports in vite that it is not working. But latter I realised that that it is an issue with vite resolution. actually vanilla-extract have striped out the query strings at vite-plugin/src/index.ts#L91. this must be actually resolved properly without this need. |
resolve.alias
is not working properly
I have the same error but I don't know how to interpret it:
The file /src/hooks/init.ts is as follows:
And the library I'm importing doesn't directly mention any "./dist/service". You can reproduce it by running
|
#bar.css?inline
)
Describe the bug
I am using vite's
resolve.alias
for aliasing my files. below is my configAll working perfectly except the
#globals.css
.It shows the below error
But if I replace my alias from
#globals.css
→#globals.css?used
all works fine. but the same issue is not occurring for other imports aliasReproduction
https://stackblitz.com/edit/vitejs-vite-encmtd
https://stackblitz.com/edit/vitejs-vite-pseonw?file=counter.js
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: