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

with-msw: Module not found: Package path ./lib is not exported from package #40775

Closed
1 task done
elbertcastaneda opened this issue Sep 21, 2022 · 2 comments · Fixed by #40777
Closed
1 task done

with-msw: Module not found: Package path ./lib is not exported from package #40775

elbertcastaneda opened this issue Sep 21, 2022 · 2 comments · Fixed by #40777
Labels
bug Issue was opened via the bug report template. examples Issue/PR related to examples

Comments

@elbertcastaneda
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
Binaries:
Node: 16.17.0
npm: 8.19.1
Yarn: 1.22.19
pnpm: 7.12.1
Relevant packages:
next: 12.3.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0

Which example does this report relate to?

with-msw

What browser are you using? (if relevant)

Version 105.0.5195.125

How are you deploying your application? (if relevant)

No response

Describe the Bug

  • When I start the app I am getting this error:
error - ./node_modules/msw/lib/index.js:455:0
Module not found: Package path ./lib is not exported from package /Users/elbertcastaneda/workspaces/softwareLab/js/nextjs-with-msw-app/node_modules/headers-polyfill (see exports field in /Users/elbertcastaneda/workspaces/softwareLab/js/nextjs-with-msw-app/node_modules/headers-polyfill/package.json)

Import trace for requested module:
./mocks/browser.ts
./mocks/index.ts
./pages/_app.tsx

https://nextjs.org/docs/messages/module-not-found

Expected Behavior

The app runs correctly

To Reproduce

  • yarn create next-app --example with-msw with-msw-app
  • cd with-msw-app
  • yarn run dev
@elbertcastaneda elbertcastaneda added the bug Issue was opened via the bug report template. label Sep 21, 2022
@balazsorban44 balazsorban44 added the examples Issue/PR related to examples label Sep 21, 2022
@balazsorban44
Copy link
Member

This originates from an upstream issue, already fixed in msw: mswjs/msw#1406

Make sure to have at least msw@0.47.3 installed. Opened a PR to update our example.

balazsorban44 added a commit that referenced this issue Sep 21, 2022
Closes #40775

<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants