Skip to content

Commit

Permalink
Fix react-native/metro bundler warning
Browse files Browse the repository at this point in the history
When using Zod in a react-native app, we see the following warning when running the bundler:
```
warn Package zod has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in <path>/node_modules/zod/package.json
```

The problem is described in react-native-community/cli#1168 and that is where it should be properly fixed. In the meantime (that issue has been open for some time), the warning can be fixed in affected packages by adding an export for `package.json`.
  • Loading branch information
adbl committed Sep 10, 2021
1 parent a9f08f0 commit 3d6e3ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "./lib/index.mjs",
"exports": {
"require": "./lib/index.js",
"import": "./lib/index.mjs"
"import": "./lib/index.mjs",
"./package.json": "./package.json"
},
"files": [
"/lib"
Expand Down

0 comments on commit 3d6e3ca

Please sign in to comment.