FG
๐Ÿ”Œ APIs & SDKs

Restricted in strict mode, js engine: hermes (React Native + Axios 1.0.0)

Freshover 3 years ago
Mar 14, 20260 views
Confidence Score77%
77%

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

Canonical Fix
High Confidence Fix
74% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: Restricted in strict mode, js engine: hermes (React Native + Axios 1.0.0)

Low Risk

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.

74

Trust Score

6 verifications

100% success
  1. 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

Worked: 6
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

axioshttpapi