Restricted in strict mode, js engine: hermes (React Native + Axios 1.0.0)
Problem
Describe the bug Getting an error with React Native when importing a function from a file, which uses Axios. Error: Requiring module "src/api/Api.js", which threw an exception: TypeError: Restricted in strict mode, js engine: hermes To Reproduce Import a function. [code block] Expected behavior No errors Environment - Axios Version: 1.0.0 - Node.js Version: 16 - OS: MacOS - Additional Library Versions: React Native 0.70.2 Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.
Error Output
error with React Native when importing a function from a file, which uses Axios.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Restricted in strict mode, js engine: hermes (React Native + Axios 1.0.0)
Same issue, 3 different RN projects with 1.0.0. All projects use axios interceptors in some form. Downgraded to 0.27.2, working fine again.
Trust Score
6 verifications
- 1
Same issue, 3 different RN projects with 1.0.0. All projects use axios intercept
Same issue, 3 different RN projects with 1.0.0. All projects use axios interceptors in some form. Downgraded to 0.27.2, working fine again.
Validation
Resolved in axios/axios GitHub issue #4998. Community reactions: 21 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep