-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restricted in strict mode, js engine: hermes #34868
Comments
Same issue here |
@hikmert This is because of Axios 1.0.0. |
downgrade axios to axios ^0.27.2 |
so the problem is axios not hermes or react-native? |
I faced the same issue. After reading the tips above, I downgraded my axios to version 0.27.2 and launched the bundler with the --reset-cache flag. It really helped. Apparently, axios uses inside some part of the code that is prohibited in Hermes, which makes it undesirable to use axios until it is fixed. Because downgrading to such a low version is extremely dangerous in production.
|
has the same issue the above fix helped it. |
I'm downgraded Axios 1.1.3 to 0.19.2 and works for me. "axios": "0.19.2" "react-native": 0.70.6 |
Downgrading Axios from ^1.1.3 to ^0.27.2 worked fine for me "react-native": "0.70.6" |
Description
After updating to RN 0.70.2 I started getting this error:
Error: Requiring module "src/api/Api.js", which threw an exception: TypeError: Restricted in strict mode, js engine: hermes
Version
0.70.2
Output of
npx react-native info
System:
OS: macOS 12.6
CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Memory: 73.93 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.0 - /usr/local/opt/node@16/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/opt/node@16/bin/npm
Watchman: 2022.10.03.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK:
API Levels: 25, 26, 27, 28, 29, 30, 31, 33
Build Tools: 30.0.3, 31.0.0, 33.0.0
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.70.2 => 0.70.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Import a function.
Snack, code example, screenshot, or link to a repository
import { logout } from './api/Api';
The text was updated successfully, but these errors were encountered: