React Native 0.79.1 errors
Problem
Describe the bug We are getting cannot find crypto and url when compiling with axios@1.9.0. [code block] To Reproduce _No response_ Code snippet [code block] Expected behavior _No response_ Axios Version _No response_ Adapter Version _No response_ Browser _No response_ Browser Version _No response_ Node.js Version _No response_ OS _No response_ Additional Library Versions [code block] Additional context/Screenshots [code block]
Error Output
Error: Unable to resolve module url from /Users/billbell/theclub/TheClub/node_modules/stream-chat/node_modules/axios/dist/node/axios.cjs: url could not be found within the project or in these directories:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: React Native 0.79.1 errors
It seems that it is not picking browser... I can force it: [code block]
Trust Score
6 verifications
- 1
It seems that it is not picking browser... I can force it:
It seems that it is not picking browser... I can force it:
textdiff --git a/node_modules/axios/package.json b/node_modules/axios/package.json index 521a676..53c7072 100644 --- a/node_modules/axios/package.json +++ b/node_modules/axios/package.json @@ -11,11 +11,11 @@ }, "browser": { "require": "./dist/browser/axios.cjs", - "default": "./index.js" + "default": "./dist/esm/axios.js" }, "default": { - "require": "./dist/node/axios.cjs", - "default": "./index.js" + "require": "./dist/browser/axios.cjs", + "default": "./dist/esm/axios.js" } }, "./lib/adapters/http.js": "./lib/adapters/http.js",
Validation
Resolved in axios/axios GitHub issue #6899. Community reactions: 16 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep