-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed as not planned
Labels
p3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)Blocking the downstream ecosystem to work properly (priority)
Description
Describe the bug
Expected Behavior
When an export condition matches it doesn't use the "browser" main field to remap it just because "browser" was set.
Actual Behavior
In our case it matches on "worker" and then gets upgraded to the "browser" version unexpectedly.
Additional Information
solidjs/solid-start#263 Lays out the issue.
This issue isn't only unexpected but it makes things very difficult. We have 3 things trying to balance:
- Server vs Browser runtimes are different for SolidJS
- Cloudflare Worker environments are Server environments for us but most tools call them browser, understandably because of Service/Web Workers. That's ok we can control this with export conditions.
- Browser mainfield support is necessary for legacy tooling support. But its existence causes the work we do to map workers to be undone.
All these seem unmoveable. But perhaps main field overriding export conditions is not. The linked issues shows our attempts at trying to fix this. And backlinks relevant Github issues.
Reproduction
https://github.com/patdx/solid-start-graphql-cloudflare/tree/main/solid-with-standard-adapter
System Info
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1
Memory: 97.66 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Browsers:
Chrome: 105.0.5195.125
Edge: 105.0.1343.53
Firefox: 102.0.1
Safari: 16.0Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)Blocking the downstream ecosystem to work properly (priority)