From 43df824ecdabeb68f11009d233de9343455ae518 Mon Sep 17 00:00:00 2001 From: tinkerbell07 Date: Fri, 10 Sep 2021 16:03:10 +0200 Subject: [PATCH] Fix react-native/metro bundler warning 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 /node_modules/zod/package.json ``` The problem is described in https://github.com/react-native-community/cli/issues/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`. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d63698a..dbfd8de 100644 --- a/package.json +++ b/package.json @@ -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"