Skip to content

TypeError: Illegal invocation error when using sse #2561

@younes101020

Description

@younes101020

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 20 or higher

Browsers

Chromium (Chrome, Brave, etc.)

Reproduction repository

https://github.com/younes101020/mswjs-nextjs-app-router-reproduction-issue

Reproduction steps

go to: https://codesandbox.io/p/github/younes101020/mswjs-nextjs-app-router-reproduction-issue/main?import=true

On right section click on preview 3000 then look at the displayed error.

Current behavior

I am encountering this error

I'm trying to intercept an sse request and mock the response, but I'm getting this error:

Image

Everything works with basic fetch.

Expected behavior

sse request to be intercepted and msw handler mocked response to be received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds:triageIssues that have not been investigated yet.potentially solvedscope:browserRelated to MSW running in a browser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions