Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to headers-polyfill@3.1 #1406

Closed
4 tasks done
aplr opened this issue Sep 15, 2022 · 4 comments · Fixed by #1407
Closed
4 tasks done

Update to headers-polyfill@3.1 #1406

aplr opened this issue Sep 15, 2022 · 4 comments · Fixed by #1407
Assignees
Labels
bug Something isn't working scope:node Related to MSW running in Node

Comments

@aplr
Copy link

aplr commented Sep 15, 2022

Prerequisites

Environment check

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

Node.js version

v16

Reproduction repository

Reproduction steps

Current behavior

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib' is not defined by "exports" in /myapp/node_modules/headers-polyfill/package.json
    at new NodeError (node:internal/errors:387:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:464:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:748:3)
    at resolveExports (node:internal/modules/cjs/loader:493:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/myapp/node_modules/msw/lib/node/index.js:658:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Use import ... from "headers-polyfill" instead of headers-polyfill/lib in

  • [src/utils/request/MockedRequest.ts](https://github.com/mswjs/msw/blob/6c6e1193327ba6c7d55826fd7997ddc9f1fb4fd5/src/utils/request/MockedRequest.ts)
  • [src/utils/request/MockedRequest.test.ts](https://github.com/mswjs/msw/blob/fc7f00c96e79ad0be83cbaf7c82ceff23f0c4355/src/utils/request/MockedRequest.test.ts)
  • [src/handlers/GraphQLHandler.test.ts](https://github.com/mswjs/msw/blob/fc7f00c96e79ad0be83cbaf7c82ceff23f0c4355/src/handlers/GraphQLHandler.test.ts)

Expected behavior

No error

@aplr aplr added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Sep 15, 2022
@kettanaito
Copy link
Member

Hey, @aplr. Thanks for reporting this.

I'm already working on the fix (see #1407). Once the CI is green, will release today.

@kettanaito kettanaito self-assigned this Sep 15, 2022
@kettanaito kettanaito removed the needs:triage Issues that have not been investigated yet. label Sep 15, 2022
@aplr
Copy link
Author

aplr commented Sep 15, 2022

@kettanaito perfect, thanks. PR wasn't there when I opened the issue.

@kettanaito
Copy link
Member

No worries.

@kettanaito
Copy link
Member

Released: v0.47.3 🎉

This has been released in v0.47.3!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:node Related to MSW running in Node
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants