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

ERR_PACKAGE_PATH_NOT_EXPORTED #742

Closed
FDiskas opened this issue Jul 13, 2022 · 1 comment
Closed

ERR_PACKAGE_PATH_NOT_EXPORTED #742

FDiskas opened this issue Jul 13, 2022 · 1 comment

Comments

@FDiskas
Copy link

FDiskas commented Jul 13, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @svgr/webpack@6.2.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@svgr/webpack/package.json b/node_modules/@svgr/webpack/package.json
@@ -3,7 +3,6 @@
   "description": "SVGR webpack loader.",
   "version": "6.2.1",
   "main": "./dist/index.js",
-  "exports": "./dist/index.js",
   "typings": "./dist/index.d.ts",
   "repository": "https://github.com/gregberge/svgr/tree/master/packages/webpack",
   "author": "Greg Bergé <berge.greg@gmail.com>",

This solves my issue with react-native project

error Failed to load configuration of your project.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in ***/node_modules/@svgr/webpack/package.json
    at new NodeError (node:internal/errors:372:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:472:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:753:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at resolveNodeModuleDir (***/node_modules/@react-native-community/cli-tools/build/resolveNodeModuleDir.js:24:42)
    at ***/node_modules/@react-native-community/cli-config/build/loadConfig.js:93:76
    at Array.reduce (<anonymous>)
@gregberge
Copy link
Owner

Fixed in #745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants