You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created an mswjs/msw#2092 at msw, but they said it's a problem of the framework (i.e. solid).
I still have to try the workaround they proposed, but the reason for the error is that vite-plugin-solid sets "browser" as resolve.conditionshere.
This means that vite tries to load the browser-version of msw/node which does not exist.
According to @kettanaito it is wrong to use browser for node.js, I personally think it is debatable.
What I also noticed is that solid returns and empty render function when the resolve.conditions is set to "node". I don't really undestand why, but it seems wrong to assume that Node.js is only ever used for SSR.
So, after some more insights, my last statement is wrong. My current stance is that the package.json of mock-service-worker is not entirely correct. The resolve.conditions applied in this module actuall contains node. So it should be possible to load msw/node
Trying to import and use any function from MSW (specifically,
msw/node
) when running vitest prints this error:This only happens when this plugin is present, removing it seems to fix the issue.
Not sure if this is a bug in the plugin, or a problem on msw's side, or if I'm maybe doing something wrong?
The text was updated successfully, but these errors were encountered: