capricorn86 / happy-dom

A JavaScript implementation of a web browser without its graphical user interface
MIT License
3.24k stars 194 forks source link

`Symbol(nodeStream)` error message with msw #1325

Closed antham closed 5 months ago

antham commented 5 months ago

Describe the bug Upgrading, from the 13.7.0 to the 13.7.1 I get this error message when performing calls with fetch with a mock defined using msw:

TypeError: Cannot read properties of null (reading 'Symbol(nodeStream)')

The error appears on all subsequent versions.

To Reproduce

I define a mock like the following using the last version of msw => https://github.com/mswjs/msw/releases/tag/v2.2.7

 server.use(
          http.put('/xxxx', async () => {
              return new HttpResponse('', { status: 204 });
          })
  );

When I define any string as the first parameter like the following, the error disappears:

 server.use(
          http.put('/xxxx', async () => {
              return new HttpResponse('No Content', { status: 204 });
          })
  );

Expected behavior Not having any error like with the 13.7.0

capricorn86 commented 5 months ago

Thank you for reporting @antham! :slightly_smiling_face:

There is a fix in now: https://github.com/capricorn86/happy-dom/releases/tag/v13.10.1

antham commented 5 months ago

Thank you for the fix 👍