Skip to content

MSW + Next.js does not intercept requests after page refresh #1698

@khoi-fish

Description

@khoi-fish

Prerequisites

Environment check

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

Node.js version

>= 16

Reproduction repository

https://github.com/khoi-fish/with-msw-fix/tree/fix

Reproduction steps

  1. yarn
  2. yarn dev
  3. Navigate to localhost:3000
  4. Notice that the page loads fine
  5. Hit refresh
  6. msw fails to intercept request and the page breaks

Current behavior

image

Expected behavior

The expectation is that refreshing should not break the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds:triageIssues that have not been investigated yet.scope:nodeRelated to MSW running in Node

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions