Skip to content

InvalidStateError: readyState not OPEN #614

@iacore

Description

@iacore

Version

v2.2.1

Platform

Linux

What steps will reproduce the bug?

  1. deno task serve
  2. modify a page, save a page, modify the same page, save the same page. do this very fast

How often does it reproduce? Is there a required condition?

the crash is probabilistic. the faster you do the sequence of actions, the more likely that deno will crash.

What is the expected behavior?

No crash

What do you see instead?

error: Uncaught (in promise) InvalidStateError: readyState not OPEN
    sockets.forEach((socket) => socket.send(message));
                                       ^
    at WebSocket.send (ext:deno_websocket/01_websocket.js:326:13)
    at https://deno.land/x/lume@v2.2.1/middlewares/reload.ts:24:40
    at Set.forEach (<anonymous>)
    at https://deno.land/x/lume@v2.2.1/middlewares/reload.ts:24:13
    at Events.dispatchEvent (https://deno.land/x/lume@v2.2.1/core/events.ts:46:19)
    at SiteWatcher.dispatchEvent (https://deno.land/x/lume@v2.2.1/core/watcher.ts:155:24)
    at https://deno.land/x/lume@v2.2.1/core/watcher.ts:166:12
    at Events.dispatchEvent (https://deno.land/x/lume@v2.2.1/core/events.ts:46:19)
    at Site.dispatchEvent (https://deno.land/x/lume@v2.2.1/core/site.ts:272:24)

Additional information

seems to be a race condition

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions