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 (React Native + Axios 1.0.0) #4998
Comments
i have the same issue in my new react native project please let me know if there is any solution for the same |
I have the same issue here. |
It's same here with a new React-native project. It doesn't allow any JS files although I set allowJs to true in tsconfig.json |
What is the solution for this |
lower axios version worked for me - axios:'0.26.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. |
I have downgrade the axios version for this issue and also add this line in my api call for use formData axios.post(url, formData, { i hope this will work for you too guys |
Downgrading Axios resolved the issue for me. |
Same issue here, as well as the same solution - downgrade to v0.26.0 |
Same issue here on axios 1.1.0, let's hope there's another solution to the downgrade |
I just tried it, it didn't work for me, the same error message keeps popping up "TypeError: Restricted in strict mode, js engine: hermes" besides a new one "[TypeError: Cannot read property 'default' of undefined]" "axios": "^1.1.2", |
i have posted the solution for same please check it out
…On Sat, 8 Oct, 2022, 11:35 pm ANDRES MADERA, ***@***.***> wrote:
Had this issue with axios 1.1.2 in react native and was able to resolve it
by replacing
import axios from 'axios' with const axios = require('axios').default;
I just tried it, it didn't work for me, the same error message keeps
popping up "TypeError: Restricted in strict mode, js engine: hermes"
besides a new one "[TypeError: Cannot read property 'default' of undefined]"
"axios": "^1.1.2",
"react": "18.1.0",
"react-native": "0.70.2",
—
Reply to this email directly, view it on GitHub
<#4998 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3N4L33SDVYGELOFFS36TETWCGZXFANCNFSM6AAAAAAQ47XETY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yes downgrading axios to 0.26.0 works, I hope that in a future version of axios we will not have this problem |
Same issue here, as mentioned by grandevel, downgrading to 0.27.2 solved it. |
@ManishBitsInfotech Dowgrading is not a fix. It does not make 1.x.x work any better. |
agree, but for now, I think if u want still using axios and the new RN version best choice is using axios |
solved it by downgrade axios version |
I got the same isssues. |
We already know that it works in 0.27, though we need to know how to make it work for 1.0ˆ, no need to keep saying downgrade works. |
same here |
i downgraded axios to 0.21.4 and the issue is gone |
…e to the 'caller', 'callee', and 'arguments' properties. TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode.
@jasonsaayman please review my fix and merge if it ok for you. |
Will do tonight when I do another release |
Thank you. |
thanks this solved it to me |
Have you been able to do release this? |
Are you releasing new version? |
i think there will be a release shortly. meanwhile using a lower version is the way to go. |
still same issue |
1 similar comment
still same issue |
This issue is making all the effort the team had made on new axios versions worthless. We are forced to use version 0.27.2 until it's fixed. Please put priority on this. If this PR solves it, please check it as soon as possible. |
While downgrading axios solves the issue, it is not recommended. What I did was to patch axios using @osielmesa PR. How to patch:
Hopefully, this resolves the issue for us while we await axios to fix it from their end or approve and merge the PR |
Downgrading to Axios 0.27.2 resolved the issue for me. "axios": "0.27.2" |
Still getting the same issue in 1.1.3 version of axios any leads on that except downgrading the version |
We are all waiting for the next release as it seems to be fixed in #5224. Only sure way for now unit then is to downgrade to 0.27.2, I saw somebody mention a patch but best to keep an eye on the releases |
npm uninstall axios => npm install axios@0.27.2 => uninstall your app and then re-install. |
Hi 👋 Please try the latest pre-release by running the following: npm i axios@1.2.0-alpha.1 Please provide feedback in either the pinned issue or discussion thread 🧵 |
Hi bro, i just installed this version, it works ! |
this worked for me too thanks |
Works like a charm, thank you |
Works perfect for me! Thanks! |
As seen in axios/axios#4998 (comment), axios causes an error in the latest RN version, therefor we need to upgrade to the most recent beta version for it to work.
Seems this is still causing issues with React Native : facebook/react-native#34688 UPDATE
This fixed it for me. |
@bombillazo There doesn't seem to be anything related to Axios v1.2.0-alpha.1 |
As seen in axios/axios#4998 (comment), axios causes an error in the latest RN version, therefor we need to upgrade to the most recent beta version for it to work.
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.
Expected behavior
No errors
Environment
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: