-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Issue: Cannot assign to read only property 'length' of function #1238
Comments
Weird, |
@DanNSam I would be fine by introducing a simple workaround, that filters out |
Thanks @mweststrate I'll check it out and change my PR if it solves the issue! |
I am going to trial these changes df5002c over the weekend and create a PR if the issue is resolved |
Trialed changes from #1257 over the weekend. There were no new error reports, I think it fixes the issue. @mweststrate, could you please review and merge #1257 if it looks good to you? I wonder if it's acceptable to remove The only reason, I can think of, why the issue originally occurred is a browser extension polyfilling/mutating |
Released as 3.3.3. Thanks for the investigation and PR! |
We have a problem happening with 92 users (it's way less than 1% of our users)
The error is
Cannot assign to read only property 'length' of function
at IObservableFactories line 1935, column 30 (webpack:///./node_modules/mobx/lib/mobx.js:1935)
It maps to line 195 in the following snippet
mobx/src/api/observable.ts
Lines 191 to 195 in b7fef45
Somehow,
IObservableFactories.prototype
have a property calledlength
. Attempting to assignobservable['length']
fails in strict mode, becauselength
is a read-only property.I found no way to reproduce it. I am really keen on blaming browser extensions, but this issue happens across multiple browsers:
I guess the only idea I have is be wrap the code assigning props into
try{} catch(e){}
or to check filter out non-writable properties.I don't mind creating a PR, but it'd be nice to know what you guys think and what approach is preferable before I do it
The text was updated successfully, but these errors were encountered: