-
-
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
resolve
conditions not respected when running the dev server / ssrLoadModule
#14496
Comments
The reason why For more details, see #13487 (comment) (It would be great if you implement |
Hmm OK I've read through this discussion. A couple of questions:
In this case it's not the build step - it's the Vite dev server (specifically
I could take a crack at this! What I did in #14498 was to set target to web and to respect resolve conditions IF ssr.target is webworker.
Thanks for the reply! |
Re item 2 in prior comment - this is similar to how the resolve plugin targets web if !ssr OR if ssr.target === 'webworker' ->
Would be aligning this behavior during ssrLoadModule , so it's consistent. |
@sapphi-red ok I took a crack at the new |
Describe the bug
I am setting resolve.conditions to
["workerd", "worker", "browser"]
, and ssr.target towebworker
, 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 byyarn start
. Note the console logs out undefined for therenderToReadableStream
import. This indicates the import resolved to the node version of react, despite the ssr target and resolve conditions.System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: