NextJS - Cannot read properties of undefined (reading 'listen') #1574
Labels
bug
Something isn't working
needs:triage
Issues that have not been investigated yet.
scope:node
Related to MSW running in Node
Prerequisites
Environment check
msw
versionNode.js version
v18.13.0
Reproduction repository
https://github.com/kevinstark86/smiley
Reproduction steps
npm install
npm run dev
Current behavior
Unable to call the correct msw setup using
server.listen()
orworker.start()
Throws an error saying "TypeError: Cannot read properties of undefined (reading 'listen')
I have followed issue #1227 which suggests that something is forcing the modules to be important asynchronously. The solution given in issue #1227 was to async await import
server
andworker
. However, this has not resolved the problem.Expected behavior
I expect the correct MSW setup to be called.
The text was updated successfully, but these errors were encountered: