Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

MessageChannel is not defined #1183

Open
TheJoshuaEvans opened this issue Dec 4, 2018 · 1 comment
Open

MessageChannel is not defined #1183

TheJoshuaEvans opened this issue Dec 4, 2018 · 1 comment

Comments

@TheJoshuaEvans
Copy link

I am attempting to use Zombie.js for testing a Message Channel generation system. However, when attempting to create the channel I get the following stack trace:

ReferenceError: MessageChannel is not defined
  at WorldTree.<anonymous> (http://localhost:3000/bifrost.js:60:21)
  at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)
  at EventTargetImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
  at EventTargetImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
  at Window.dispatchEvent (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
  at Window.DOM.EventTarget.dispatchEvent (node_modules/zombie/lib/dom/jsdom_patches.js:177:31)
  at Window.window.postMessage (node_modules/zombie/lib/document.js:452:10)
  at new RealmTower (http://localhost:3000/bifrost.js:170:29)
  at window.addEventListener (http://localhost:3000/ideal/child.html:script:21:26)
  at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)

It appears as though the MessageChannel "class" is not defined. This may be an underlying issue with JSDom (looking at the stack trace), rather than Zombie itself

According to the MDN documentation, MessageChannel is supported all the way back to IE10, so it seems strange to me that it's not valid here
https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel

@TheJoshuaEvans
Copy link
Author

I did some testing and found that jsdom was the issue, and opened a new ticket there as well:
jsdom/jsdom#2448

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

No branches or pull requests

1 participant