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

SCRIPT5045: Assignment to read-only properties is not allowed in strict mode IE11 #341

Closed
varadharajan007 opened this issue Oct 6, 2017 · 4 comments

Comments

@varadharajan007
Copy link

when try to open my angular2 project in IE11, i am getting this error

"SCRIPT5045: Assignment to read-only properties is not allowed in strict mode
vendor.bundle.js (8031,5)".

In vendor.bundle.js file ,
Debugger is point on this function
--> ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) {
if (fromIndex === void 0) { fromIndex = 0; }
var idx = this.findIndex.apply(this, arguments);
return idx === -1 ? undefined : this.get(idx);
};

please let me know about solutions.

@zloirock
Copy link
Owner

zloirock commented Oct 8, 2017

I don't see anything related core-js here. ObservableArray is not a part of core-js.

@zloirock zloirock closed this as completed Oct 8, 2017
@mweststrate
Copy link

See also: mobxjs/mobx#1028 (comment). The MDN official polyfill incorrectly creates a non-configurable, non-writable property. (Just submitted an issue to MDN to fix that).

If core-js also introduces Array.prototype.find with a property descriptor that is not: { configurable: true, enumerable: false, writable: false}, than this could be an issue.

Since I am completely unfamiliar with core-js, I don't know how to check that quickly (couldn't find it in the source code)

@zloirock
Copy link
Owner

@mweststrate by the spec, Array.prototype.find descriptor should be {writable: true, enumerable: false, configurable: true} and core-js use it. Because of usagedefineProperty in core-js for polyfilling Array.prototype.find, this incorrect descriptor from MDN polyfill should not be a problem. How it's related this issue?

@mweststrate
Copy link

I don't know if it is related, hence the question :) I wanted to check that, but didn't know how (I don't have a project using core-js in its build lingering around anywhere, and searching the sources didn't give a clue), so figured I could ask instead :-).

I got this issue reported a few times, but most people themselves hardly know where their polyfills are coming from, so wanted to double check that core-js isn't causing it.

Thanks for the info!

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

No branches or pull requests

3 participants