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
fix(test): resolve ws CJS named export error with cloudflare preset
closes#831
When Nuxt's cloudflare preset is active, vitest passes `--conditions browser`
to worker processes. This caused `ws` to resolve to its browser stub
(`ws/browser.js`) instead of the ESM wrapper (`ws/wrapper.mjs`), because
the test package's `node` export condition loaded `index-node.js` which
imports `@vitest/browser/index.js` → `ws`.
Fix by adding a `browser` export condition before `node` in the test
package's main export. When `--conditions browser` is active, `browser`
matches first and resolves to `dist/index.js` (which doesn't pull in
`@vitest/browser`), avoiding the ws resolution issue.
Also fix ecosystem-ci `patch-project.ts` to apply pnpm overrides for
projects that already use Vite+ (previously skipped by `vp migrate`),
and add the reproduction repo as an e2e test case.
0 commit comments