Skip to content
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

TypeError: Restricted in strict mode, js engine: hermes #5231

Closed
Ashabu opened this issue Nov 6, 2022 · 4 comments
Closed

TypeError: Restricted in strict mode, js engine: hermes #5231

Ashabu opened this issue Nov 6, 2022 · 4 comments

Comments

@Ashabu
Copy link

Ashabu commented Nov 6, 2022

Describe the bug

For newer versions of React Native, v0.7.0 and above (using 0.70.4), when I import the axios (version 1.0.0 and above) from the axios module I get this error message:
'TypeError: Restricted in strict mode, js engine: hermes'.
When I try to require it ------ const axios = require('axios').default , I get this error message:
'Error: Requiring module "node_modules/axios/index.js", which threw an exception: TypeError: Restricted in strict mode, js engine: hermes'.

The only solution was to downgrade to versions that are less then 1.0.0, in my case to 0.27.2

To Reproduce

No response

Code snippet

No response

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

No response

Additional context/Screenshots

No response

@code-fi
Copy link

code-fi commented Nov 6, 2022

refer to #5152

for a temporal fix, refer comment

@jasonsaayman
Copy link
Member

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 the discussion thread 🧵

@punndcoder28
Copy link

Hi @jasonsaayman . Could you point me to either the pinned issue or the discussion thread. I could not find either of the two on the repo

@jasonsaayman
Copy link
Member

@punndcoder28 it was closed as we have released the version. If something is an issue please open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants