[Bug] Chrome/49 - Cannot redefine property: hasInstance
See original GitHub issue- Browser: Chrome/49.0.2623.112
- Os: Windows NT 6.0
- Error: Cannot redefine property: hasInstance
Error as described in Datadog
TypeError: Cannot redefine property: hasInstance
at Function.defineProperty @ <anonymous>
at <anonymous> @ https://polyfill.io/v3/polyfill.min.js?features=default%2Ces2015%2CNodeList.prototype.forEach%2Cfetch:3:17056
at <anonymous> @ https://polyfill.io/v3/polyfill.min.js?features=default%2Ces2015%2CNodeList.prototype.forEach%2Cfetch:3:25647
User-Agent as described in Datadog
Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
I tried creating a simple html and spoofing the user agent, but it still happened.
test.html
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=Symbol.hasInstance"></script>
</head>
<body>
test
</body>
</html>
Error as described in Chrome Console
Uncaught TypeError: Cannot redefine property: hasInstance
at Function.defineProperty (<anonymous>)
at polyfill.min.js?features=Symbol.hasInstance:3
at polyfill.min.js?features=Symbol.hasInstance:3
I think it’s the correct behavior to be called in Chrome version 49
.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance
I think the chrome = "< 50"
setting in the config for hasInstance
is also correct.
https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Symbol/hasInstance/config.toml#L13
I check into it so far, but I’m just not sure.
Please confirm the above.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
[BUG] TypeError: Cannot redefine property: webdriver #185
Environment chrome-aws-lambda 5.5.0: puppeteer-core 5.5.0: OS: Mac Node.js Version: 14.x Current Behavior Error: TypeError: Cannot redefine ...
Read more >Reimplemented Constructor[Symbol.hasInstance] but it still ...
It returns false : you cannot write to the Symbol.hasInstance property of a function with the assignment = operator. The property never gets ......
Read more >Origami Newsletter, December 2020 - Financial Times
[Bug] Chrome/49 - Cannot redefine property: hasInstance ... Allow getters and setters to be set to undefined and not throw an error.
Read more >393988 - TypeError: Cannot redefine property: stack - chromium
The following code runs fine on M36. But it throws "Cannot redefine property: stack" in M37. Is this a regression? <!DOCTYPE html>
Read more >Symbol.toStringTag - JavaScript - MDN Web Docs
toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Correct, spoofed user agents is not something polyfill.io supports. You need to use the real Chrome 49 to test it, which I’ve done above and shown is working correctly
I’ve tested this in Chrome 49 and it does not throw an error:
This is the site I tested with: – https://jsbin.com/judugiqari/edit?html,output