question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MessageChannel not defined in nodejs

See original GitHub issue

(node:9929) UnhandledPromiseRejectionWarning: ReferenceError: MessageChannel is not defined

MessageChannel comes from worker_threads package but comlink is using the global one.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

1reaction
afbarbarocommented, Mar 31, 2021

ok, it’s a pretty easy fix. I’ll open a PR tomorrow.

1reaction
FranklinWallercommented, Jun 12, 2020

This is probably an oversight since in the examples folder there is a node example. This mostly occurs when using the proxy function which does not allow an argument for setting the endpoint.

Tried fixing this in my project by exposing MessageChannel on the global object and wrapping each MessagePort with the nodeEndpoint() (Can this get any dirtier). But that would get stuck on the objects not being transferable. I haven’t looked in too much why this happens but at this point, I’m just better of working with raw workers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: MessageChannel is not defined #2984 - GitHub
Basic info: Node.js version: v12.16.1 jsdom version: 16.2.2 Minimal reproduction case const axios = require("axios"); const { JSDOM } ...
Read more >
'MessageChannel is undefined' triggered on pages with ...
I'm currently trying to scrape some sites that have recaptcha implemented, but whenever i load the page's source i get this error: (node:15536) ......
Read more >
MessageChannel JavaScript and Node.js code examples
Ensures gutenboarding status and corresponding data is placed on the calypsoifyGutenberg object. * This is imporant because it allows us to adapt small ......
Read more >
MessageChannel - Web APIs | MDN
The MessageChannel interface of the Channel Messaging API allows us to create a new message channel and send data through it via its...
Read more >
message.channel.fetchMessage is not a function Code Example
what you are trying to write was taken out of discord.js v12 message.channel.messages.fetch()
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found