MaxListenersExceededWarning is shown by React.StrictMode #1650
Replies: 3 comments 7 replies
-
bumping this as I'm facing the same issue when running tests with jest & msw as soon as 10 handlers are set. |
Beta Was this translation helpful? Give feedback.
-
Looks like this should be relatively unrelated to strict mode, since it's per-request listeners, but I've reproduced this in a test - #1910 and we can work on improving the cause, but there's no actual issue besides some log noise |
Beta Was this translation helpful? Give feedback.
-
Hi @yunics-highfield , Although the msw docs don't mention it, if you're using msw as part of your testing suite and the specifics of your problem are because of listeners on the afterEach(() => {
server.events.removeAllListeners();
server.resetHandlers();
}); @kettanaito : I'm not sure if the msw docs would benefit with this suggestion in regards to msw for testing scenarios. Also not sure if it's relevant to the issues/fixes that @mattcosta7 was doing in #1911 and #1914. In any case, these back links might help future visitors. I also commented in this discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a React project with msw. MaxListenersExceededWarning is shown on console when I use React.StrictMode and fetch about 10 or more mock data on my application. I'd like to resolve it. How do you guys treat with it below?
Beta Was this translation helpful? Give feedback.
All reactions