question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 https://github.com/EverlongProject/create-react-app/pull/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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:10

github_iconTop GitHub Comments

4reactions
nikhiltechcommented, Jun 11, 2020

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

0reactions
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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add polyfill for String.repeat function for ie11?
I am not using it directly in my code, it's probably some of the imported libs. In IE console I get this error:...
Read more >
[Solved]-Object doesn't support property or method 'entries'
Coding example for the question Object doesn't support property or method 'entries' - error in IE11-Reactjs.
Read more >
Using Plugin breaks all images on IE 11 only - WordPress.org
When I install this plugin, I get the following console error in IE. SCRIPT438: Object doesn't support property or method 'repeat' js.js (160,4)....
Read more >
object doesn't support property or method 'from' ie11 polyfill, object ...
In IE11, some CLI scripts have not yet been downloaded (including polyfills) which causes the Object doesn't support property or method 'from' exception....
Read more >
Object doesn't support property or method includes - Polyfill ...
Hi, I created a project with VueJS 2.6.11 and unfortunately need to ensure support for IE11. The error in the console shows: “Object...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found