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

ERROR Error: Uncaught (in promise): TypeError: Cannot assign to read only property 'readyState' of object" #168

Open
JeCap opened this issue Apr 20, 2021 · 2 comments

Comments

@JeCap
Copy link

JeCap commented Apr 20, 2021

Describe the bug

In different situations (timeout/connections lost/network disconnected) it is written on "readonly" member on a trusted event object and exceptions are thrown.

To Reproduce

Steps to reproduce the behavior:

  1. Open chrome console log
  2. Force a 45s timeout (Set server heartbeat to 120s)
  3. See errors
  4. Exception "No activity within 45000 milliseconds" is ok and caught.
  5. Exception "ERROR Error: Uncaught (in promise): TypeError: Cannot assign to read only property 'readyState' of object" is NOT ok and not caught.

Expected behavior

No exception at this point and do not try to write on read only, trusted objects

Screenshots

image

@Yaffle
Copy link
Owner

Yaffle commented Apr 20, 2021

This is not trusted event object, just the plain EventSourcePolyfill object.
Have you made the property read-only somehow? var es = Object.freeze(new EventSource(...)) ?
or you have created a read-only property Object.prototype.readyState...

@JeCap
Copy link
Author

JeCap commented Apr 20, 2021

This is not trusted event object, just the plain EventSourcePolyfill object.
Have you made the property read-only somehow? var es = Object.freeze(new EventSource(...)) ?
or you have created a read-only property Object.prototype.readyState...

Sorry, my mistake. Too many open repositories(forks) for "EventSource" at the same time. I post this issue in the wrong repo.
I used a fork of "EventSource" (https://github.com/sguiheux/EventSource) with Angular 11. I'm now trying to integrate this implementation.
thx4hlp

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

2 participants