-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Closed
Copy link
Labels
Description
Describe the bug
I am setting resolve.conditions to ["workerd", "worker", "browser"], and ssr.target to webworker, so that imported packages use the browser/worker/edge versions if available.
This works fine during vite build, but it seems these config options are not respected when running the vite dev server or manually creating a server and using ssrLoadModule.
Reproduction
https://github.com/marbemac/vite-ssr-resolve-bug
Steps to reproduce
yarn followed by yarn start. Note the console logs out undefined for the renderToReadableStream import. This indicates the import resolved to the node version of react, despite the ssr target and resolve conditions.
System Info
System:
OS: macOS 13.5.2
CPU: (10) arm64 Apple M1 Max
Memory: 60.00 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.13.0/bin/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
pnpm: 8.8.0 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 117.0.5938.132
Safari: 16.6
npmPackages:
vite: 4.4.9 => 4.4.9Used Package Manager
yarn
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.