MSW mock server not handling `secureConnect`
Prerequisites
- [x] I confirm my issue is not in the opened issues
- [x] I confirm the Frequently Asked Questions didn't contain the answer to my issue
Environment check
- [x] I'm using the latest
mswversion - [x] I'm using Node.js version 20 or higher
Node.js version
v22.13.1
Reproduction repository
https://github.com/juicemia/repro-msw-secureconnect-issue
Reproduction steps
pnpm i
pnpm test
Current behavior
The secureConnect event is not being correctly handled. HTTP requests made using the NodeHttpClient in the reproduction repository will hang indefinitely.
Expected behavior
I expected HTTP requests made using the NodeHttpClient in the reproduction repository to complete successfully.
I opened https://github.com/mswjs/interceptors/pull/745 that makes the tests in the reproduction repo all pass when I use it in place of the upstream.
To do this I added an override for pnpm to use my local copy of the interceptors package:
"pnpm": {
"overrides": {
"@mswjs/interceptors": "file:/path/to/local/projects/juicemia/mswjs-interceptors"
}
I then built the interceptors package using pnpm build and installed it in the reproduction repo by removing node_modules and running pnpm i again.