-
-
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
fix(vite): conditional exports can't be active when key is browser (#18012) #18016
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
@NWYLZW Would you elaborate your usecase? Are you testing a library using Vitest for browser on Node without any shims like JSDOM? I think this is related to #9860. |
I don't need
The scenario is somewhat similar to what was mentioned in #9860, but the way it is handled causes |
# Conflicts: # packages/vite/src/node/plugins/resolve.ts
Hey, I noticed that the current I still firmly believe that if a user explicitly declares the corresponding conditional, we should respect their configuration. They shouldn't have to configure another option for this to work. If needed, I can also add related unit tests. |
There are some issues with the unit tests, but it seems that I did not introduce them. |
Description
#18012 (comment)
Based on my debugging results, the handling here seems a bit too tightly coupled with SSR. For other users encountering this issue, you can try setting the
ssrTarget
parameter to 'webworker'. However, I believe this area should take into account that the user has already actively declared the conditional.