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

IE11. Object doesn't support property or method 'repeat' #8974

Closed
nmoinvaz opened this issue May 7, 2020 · 10 comments
Closed

IE11. Object doesn't support property or method 'repeat' #8974

nmoinvaz opened this issue May 7, 2020 · 10 comments

Comments

@nmoinvaz
Copy link

nmoinvaz commented May 7, 2020

Describe the bug

When throwing an error using JS throw during IE11 development, the following script error dialog occurs:

Object doesn't support property or method 'repeat'

It is similar to the issue #8438 and #8405 except that it is in reference to repeat from String.prototype.repeat instead of entries from Object.entries.

The Object.entries issue was fixed in a CRA fork EverlongProject#9. A similar fix might be needed for String.prototype.repeat.

The problem does not resolve itself when adding core-js package.

Did you try recovering your dependencies?

No

Which terms did you search for?

A combination of "object support repeat" in the GitHub issues.

Environment

npx: installed 98 in 6.932s

Environment Info:

  current version of create-react-app: 3.4.1
  running from C:\Users\Nathan\AppData\Roaming\npm-cache\_npx\35912\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  Binaries:
    Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.4 - C:\Users\Nathan\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
    Internet Explorer: 11.0.18362.1
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.1 => 3.4.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Add this to the constructor of App.js:
setTimeout(() => { throw new Error("Test throw!!"); }, 3000);
  1. Open and view in IE11 and wait 3 seconds

Expected behavior

It should show the react error screen.

Actual behavior

Internet Explorer 11 shows an script error dialog containing the following:

errorLine (1)
errorCharacter (250504)
errorCode (0)
errorMessage (Object doesn't support property or method 'repeat')

Reproducible demo

None

@nikhiltech
Copy link

nikhiltech commented May 8, 2020

@nmoinvaz Hey, Are you using "immer", the produce method of immer was causing issue for me.

@katiawheeler
Copy link

katiawheeler commented Jun 4, 2020

@nikhiltech I am running into this same issue and am using immer - were you able to find a workaround?

@katiawheeler
Copy link

@nikhiltech never mind! I updated to v 6.0.9 of immer and it seems to be working now.

@yaxianglu
Copy link

I have the same problem. How did you solve it?I suspect I used React.Provider, but I don't know how to solve it

@nikhiltech
Copy link

@littleLuyx use import { enableES5 } from "immer"; enableES5();
where you are using immer

@yaxianglu
Copy link

yaxianglu commented Jun 16, 2020

@littleLuyx use import { enableES5 } from "immer"; enableES5();
where you are using immer

Thank you. It's very instructive. I didn't use immer in my document, but I was prompted with syntax errors. Finally, I introduced core-js to solve this problem

@stale
Copy link

stale bot commented Jul 18, 2020

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.

@stale stale bot added the stale label Jul 18, 2020
@nmoinvaz
Copy link
Author

nmoinvaz commented Jul 18, 2020

I was not using immer. I think it is due to the error panel library that is being used not supporting legacy browsers.

@stale stale bot removed the stale label Jul 18, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

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.

@stale stale bot added the stale label Aug 22, 2020
@stale
Copy link

stale bot commented Aug 29, 2020

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.

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

No branches or pull requests

4 participants