sodatea / vite-jest

First-class Vite integration for Jest
MIT License
401 stars 51 forks source link

Module "stream" has been externalized for browser compatibility and cannot be accessed in client code. #38

Open MarkLyck opened 2 years ago

MarkLyck commented 2 years ago

When trying to run this in my project I get this error for all my 144 test suites:

  ● Test suite failed to run

    Module "stream" has been externalized for browser compatibility and cannot be accessed in client code.

      at Object.get (node_modules/.vite/browser-external:stream:3:11)
      at node_modules/node-fetch/lib/index.mjs (node_modules/node-fetch/lib/index.mjs:11:25)
      at __init (node_modules/.vite/chunk-32SO2RNX.js:33:56)
      at node_modules/msw/lib/esm/fetch-deps.js:968:48
          at runMicrotasks (<anonymous>)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)

Any idea what this means?