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

Module not found: Error: Package path . is not exported from package #49

Closed
Lornz- opened this issue Apr 26, 2023 · 3 comments
Closed
Assignees
Labels
question Further information is requested wontfix This will not be worked on

Comments

@Lornz-
Copy link

Lornz- commented Apr 26, 2023

Hi there!

I'm working on a project using Gatsby.js. Lately I upgraded dependencies to their latest version using node 18 from node 16. The upgrade went smoothly until I encountered this error during the build:

ModuleNotFoundError: Module not found: Error: Package path . is not exported from package /Users/.../node_modules/i18n-postal-address (see exports field in /Users/.../node_modules/i18n-postal-address/package.json)

As mentioned, it seems coming from the exports field

I can't figure it out why.

Steps to Reproduce

  1. Add i18n-postal-address as a project dependency yarn add i18-postal-address or npm install i18-postal-address
  2. Import and use i18n-postal-address as described https://github.com/joaocarmo/i18n-postal-address#with-a-bundler--nodejs
  3. Build the project yarn build or npm run build

Your Environment

macOS Ventura 13.2.1
VSCode 1.77.3
Yarn 1.22.19
Node.js v18.12.1
React 18.2.0
Gatsby 5.9.0

@Lornz-
Copy link
Author

Lornz- commented Apr 26, 2023

It's probably related microsoft/TypeScript#51862 (comment) which can be change here in the tsconfig.json file.

@Lornz- Lornz- changed the title ModuleNotFoundError: Module not found: Error: Package path . is not exported from package Module not found: Error: Package path . is not exported from package Apr 26, 2023
@joaocarmo joaocarmo self-assigned this Oct 4, 2023
@joaocarmo joaocarmo added the bug Something isn't working label Oct 4, 2023
@joaocarmo
Copy link
Owner

Did you take a look at Gatsby's limitations with TypeScript e.g., require.resolve?

@joaocarmo joaocarmo added question Further information is requested wontfix This will not be worked on and removed bug Something isn't working labels May 12, 2024
@joaocarmo
Copy link
Owner

Closing due to lack of feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants