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

Bad resource ID error when writing to BroadcastChannel #16978

Closed
ayame113 opened this issue Dec 7, 2022 · 1 comment · Fixed by #17366
Closed

Bad resource ID error when writing to BroadcastChannel #16978

ayame113 opened this issue Dec 7, 2022 · 1 comment · Fixed by #17366
Assignees

Comments

@ayame113
Copy link
Contributor

ayame113 commented Dec 7, 2022

When I run the code below, I get "error: Uncaught (in promise) BadResource: Bad resource ID".

const bc = new BroadcastChannel("internal_notification");
bc.postMessage("New listening connected!");
bc.close();

The data seems to be written successfully, but isn't it a bug that the error still occurs?

A workaround I found is to add a setTimeout before close.

const bc = new BroadcastChannel("internal_notification");
bc.postMessage("New listening connected!");
setTimeout(() => {
  bc.close();
}, 1000);
> deno --version
deno 1.28.3 (release, x86_64-pc-windows-msvc)
v8 10.9.194.5
typescript 4.8.3
@bartlomieju
Copy link
Member

@crowlKats please take a look

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

Successfully merging a pull request may close this issue.

3 participants