Create-react-app: react-app-polyfill giving error on IE11 (Cannot redefine non-configurable property 'caller')

Created on 25 Mar 2020  路  4Comments  路  Source: facebook/create-react-app

Describe the bug

I've installed react-app-polyfill on react app, while adding this line of code on the top of my index.tsx

import 'react-app-polyfill/ie11'; import 'core-js/stable'; import 'regenerator-runtime/runtime';
also tried
import 'react-app-polyfill/ie11'; import 'react-app-polyfill/stable .

It kept giving me SCRIPT5078: Cannot redefine non-configurable property 'caller' on IE.

Did you try recovering your dependencies?

Cleared and deleted all dependencies, cleard cache, tried it on react-scripts 3.2.0 & 3.3.0 & 3.4.0

(Write your answer here.)

Which terms did you search for in User Guide?

  • Searched the error i got, "react-app-polyfil IE support" ,read the documentation of the react-app-polyfill, core-js and babel-polyfill, none of the proposed solutions worked.

Environment

related dependencies in the project:

"react": "^16.12.0",
 "react-scripts:"3.3.0",(also tried it with 3.2.0 and 3.4.0)
"react-app-polyfill": "^1.0.6",
 "regenerator-runtime": "^0.13.5",
 "typescript": "3.5.3",
"core-js": "^3.6.4",

Steps to reproduce

  • As described above, install react-app-polyfill, core-js, babel-present-env, and regenerator-runtime and imported them at the top of my index.tsx

Expected behavior

polyfilling on IE should at least work without giving any error related to it.

Actual behavior

It's giving error: "Cannot redefine non-configurable property 'caller'"

image

bug report needs triage stale

Most helpful comment

I was able to solve that problem by importing what I need need to run my app on IE. The method caller was defined in "object" so i only imported object.values() from it.

import 'react-app-polyfill/ie11'; import 'core-js/es/object/values'; import 'core-js/es/promise'; import 'core-js/es/array'; import 'core-js/stable/string'; import 'core-js/stable/number';

You might try importing the only methods you use from array/string.

All 4 comments

Hello,

I'm getting the same error with includes:
"cannot redefine non-configurable property includes"

"react": "^16.12.0",
 "react-app-polyfill": "^1.0.6",

I was able to solve that problem by importing what I need need to run my app on IE. The method caller was defined in "object" so i only imported object.values() from it.

import 'react-app-polyfill/ie11'; import 'core-js/es/object/values'; import 'core-js/es/promise'; import 'core-js/es/array'; import 'core-js/stable/string'; import 'core-js/stable/number';

You might try importing the only methods you use from array/string.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrice727 picture adrice727  路  3Comments

ap13p picture ap13p  路  3Comments

rdamian3 picture rdamian3  路  3Comments

onelson picture onelson  路  3Comments

dualcnhq picture dualcnhq  路  3Comments