-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
ESM subpath imports fail to be resolved by vite:import-analysis
#12370
Labels
Comments
Start a new pull request in StackBlitz Codeflow. |
tsujp
changed the title
ESM subpath issues fail to be resolved by
ESM subpath imports fail to be resolved by Mar 11, 2023
vite:import-analysis
vite:import-analysis
sun0day
added a commit
to sun0day/vite
that referenced
this issue
Mar 11, 2023
9 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Directly related to this issue: #7770 which I have commented on also.
Looks like this has been included in Vite
4.2.0-beta.1
. The changes tovite:resolve
appear to work as it does resolve a subpath import correctly but it cannot be used with a real world codebase becauseimport-analysis
does not understand what to do with a subpath import when given it and so it resolves tonull
instead which returns:Annotated with a bunch of
console.log
statements when trying to debug this I can see the following:(1) is from within
vite:import-analysis
right before it switches onif (!resolved)
.(2) is from within that
if
statement.(3) is from within
vite:resolve
.import-analysis
calls some resolve method (I'm working with the post-bundled source here so there are umpteen definitions for that function) which doesn't know what to do hence the failure.I'll try actually find this in the normal codebase before it's been bundled.
Minimum reproducible example here: https://stackblitz.com/edit/github-c6tkmr-1eubsp?file=src/index.tsx
Reproduction
https://stackblitz.com/edit/github-c6tkmr-1eubsp?file=src/index.tsx
Steps to reproduce
See above reproducible link.
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: