Yaffle / EventSource

a polyfill for http://www.w3.org/TR/eventsource/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

JeCap opened this issue · comments

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

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

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