From 335b79ffb6d67336b2c6836893848eb247568b6a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 10 Feb 2026 03:04:23 -0330 Subject: [PATCH] fix: fix export for React Native and Browserify (#7386) Browserify and React Native projects (that aren't using `unstable_enablePackageExports`) use the `main` field as the package entrypoint. A recent PR (#5756) updated `main` to use a CommonJS bundle for Node.js, which caused Browserify and React Native projects to use the Node.js bundle. This led to many reports of broken React Native builds. This has been fixed by adding an entry to `browser` and `react-native` to re-map the Node.js CommonJS bundle to the browser CommonJS bundle. --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 8dc8bb9e..57df1d57 100644 --- a/package.json +++ b/package.json @@ -149,11 +149,13 @@ "typescript": "^4.9.5" }, "browser": { + "./dist/node/axios.cjs": "./dist/browser/axios.cjs", "./lib/adapters/http.js": "./lib/helpers/null.js", "./lib/platform/node/index.js": "./lib/platform/browser/index.js", "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" }, "react-native": { + "./dist/node/axios.cjs": "./dist/browser/axios.cjs", "./lib/adapters/http.js": "./lib/helpers/null.js", "./lib/platform/node/index.js": "./lib/platform/browser/index.js", "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"