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

Uncaught ReferenceError: BroadcastChannel is not defined #13214

Closed
jsejcksn opened this issue Dec 28, 2021 · 4 comments
Closed

Uncaught ReferenceError: BroadcastChannel is not defined #13214

jsejcksn opened this issue Dec 28, 2021 · 4 comments
Labels

Comments

@jsejcksn
Copy link
Contributor

jsejcksn commented Dec 28, 2021

BroadcastChannel:

  • is listed in the stable docs

  • is not listed in the unstable docs

  • throws a ReferenceError without using --unstable:

    $ deno repl
    Deno 1.17.1
    exit using ctrl+d or close()
    > new BroadcastChannel()
    Uncaught ReferenceError: BroadcastChannel is not defined
        at <anonymous>:2:1
    > close()
    
    $ deno repl --unstable
    Deno 1.17.1
    exit using ctrl+d or close()
    > new BroadcastChannel()
    Uncaught TypeError: Failed to construct 'BroadcastChannel': 1 argument required, but only 0 present.
        at Object.requiredArguments (deno:ext/webidl/00_webidl.js:627:13)
        at new BroadcastChannel (deno:ext/broadcast_channel/01_broadcast_channel.js:81:14)
        at <anonymous>:2:1
    > close()
    

Is this a bug or just a docs problem? I searched through several pages of release notes and found only this mention in v1.11.0:

  • feat(extensions): add BroadcastChannel
@bnoordhuis
Copy link
Contributor

It's a documentation issue, BroadcastChannel is still an unstable feature.

I suspect it's caused by the inclusion of ext/broadcast_channel/lib.deno_broadcast_channel.d.ts in cli/dts/lib.deno.shared_globals.d.ts (BroadcastChannel is a browser global.)

@emschwartz
Copy link

emschwartz commented Oct 2, 2022

Looks like it's still unstable in 1.26.0 while the docs list it as stable 😿

@emschwartz
Copy link

I'm curious about the actual (in)stability of this feature, given that it's supported on Deno Deploy 🤔 https://deno.com/deploy/docs/runtime-broadcast-channel

@jsejcksn
Copy link
Contributor Author

Closed by #19108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants