Open trm217 opened 3 days ago
https://github.com/trm217/reproduction-nextjs-playwright-msw-issue
pnpm i
pnpm build
pnpm exec playwright test
I would expect the error TypeError: _msw.MockedRequest is not a constructor not to be thrown, as it doesn't allow using the testmode feature at all.
TypeError: _msw.MockedRequest is not a constructor
The error occurs when ever the import path given in this example is used (this file in the reproduction).
Operating System: Platform: darwin Arch: arm64 Binaries: Node: 21.2.0 npm: 10.2.3 Yarn: 1.22.22 pnpm: 9.1.0 Relevant Packages: next: 14.2.4 // Latest available version is detected (14.2.4). eslint-config-next: 14.2.4 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.2 Next.js Config: output: N/A
Testing
Other (Deployed)
No response
Link to the code that reproduces this issue
https://github.com/trm217/reproduction-nextjs-playwright-msw-issue
To Reproduce
pnpm i
pnpm build
pnpm exec playwright test
.Current vs. Expected behavior
I would expect the error
TypeError: _msw.MockedRequest is not a constructor
not to be thrown, as it doesn't allow using the testmode feature at all.The error occurs when ever the import path given in this example is used (this file in the reproduction).
Provide environment information
Which area(s) are affected? (Select all that apply)
Testing
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response