question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(v.0.42) Error - Invariant Violation: Failed to respond request: the "request" event has already been responded to

See original GitHub issue

Prerequisites

Environment check

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

Node.js version

v16.15.0

Reproduction repository

https://github.com/7iomka/next-with-msw-and-effector

Reproduction steps

yarn add msw@latest yarn dev

Current behavior

error - Invariant Violation: Failed to respond to "GET http://localhost:3000/backend-api/xxxx" request: the "request" event has already been responded to.
    at setupServerListener (************/node_modules/msw/lib/node/index.js:1249:17) {

Expected behavior

All works as in v0.38.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:25 (12 by maintainers)

github_iconTop GitHub Comments

9reactions
kettanaitocommented, Jun 22, 2022

Hey, my pleasure, @M3kH! I’m happy we were able to find a solution that’s not entirely hacky. HMR is tricky, and it depends on the module evaluation, so certain modules are “preserved” while certain are re-evaluated. Funny how moving a class instantiation into a different module affects how that class will behave when under hot reload. If anything, the hot reload itself feels magical (perhaps too magical?).

That being said, if you like my work and would like for MSW to grow and improve, please consider sponsoring the project on GitHub. Let’s build sustainable open source together, where features and bug fixes don’t cost maintainer’s personal lives and time.

3reactions
MathieuDoyoncommented, Jun 14, 2022

I’m getting it with https://github.com/vercel/next.js/tree/canary/examples/with-msw just by upgrading dependency to "msw": "^0.42.1",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service worker error: event already responded to
Uncaught (in promise) DOMException: Failed to execute 'respondWith' on 'FetchEvent': The event has already been responded to. I know that ...
Read more >
NUREG/CR-1278, "Handbook of Human Reliability Analysis ...
assumes that all of the ANNs (or completely dependent sets of ANNs) are equal in terms of the probability of being noticed. See...
Read more >
Competition between parallel sensorimotor learning systems
Sensorimotor learning is supported by at least two parallel systems: a strategic process that benefits from explicit knowledge and an implicit process that ......
Read more >
DESCRIPTORS. examines qUestions and responses ... - ERIC
examines qUestions and responses ofchildren aged.8-16, and in particular, the role that curiosity and questions can play in learning.
Read more >
Buying Intentions and Purchase Probability: I
Hence, the responses on a survey of buying intentions have behavioral ... if the cut-off probability were invariant, given the same proportion of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found