-
-
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
Rollup failed to resolve import (Vite 2.0.0-beta.1) #1291
Comments
I have investigated this a bit further. I looked at different NPM packages triggering this issue, and noticed the following commonality: in the case of
(and there's indeed a file Other packages that I've ran into the same issue with (e.g. I can't investigate much further as it would involve a knowledge of Rollup's resolution system that I don't have, but I hope with this information someone better informed will know what the issue is! Thanks in advance. |
Seems Vite uses this regexp to match module id: vite/packages/vite/src/node/utils.ts Line 12 in 03f25a3
Which gives you vite/packages/vite/src/node/plugins/resolve.ts Lines 179 to 181 in 03f25a3
|
@egoist thanks for taking a look. I continued investigating from the code you linked and I think everything is fine up to this point:
So it'd seem like a way to solve this issue would be to add a case to this function to handle the scenario where the path points to a directory that contains a |
@yyx990803 I saw the issue got closed without a comment and I thought "??", then clicked on it and saw the commit. Thanks for the amazingly fast bug-fix! ❤️ |
Thanks for the amazing work on vite & happy new year! :)
Describe the bug
Dependency optimisation fails for
reakit
, which is supposedly ESM-compatible, with the following error:This problem seems widespread; I've encountered it with many packages that worked fine on Vite 1.0.0-rc.13
Reproduction
src/App.tsx
by adding this import:You should see the error pasted above.
System Info
vite
version: v2.0.0-beta.1Non-exhaustive list of packages that (directly or indirectly) exhibit this issue
The text was updated successfully, but these errors were encountered: