zombie icon indicating copy to clipboard operation
zombie copied to clipboard

MessageChannel is not defined

Open TheJoshuaEvans opened this issue 7 years ago • 1 comments

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 avatar Dec 04 '18 23:12 TheJoshuaEvans

I did some testing and found that jsdom was the issue, and opened a new ticket there as well: https://github.com/jsdom/jsdom/issues/2448

TheJoshuaEvans avatar Dec 05 '18 00:12 TheJoshuaEvans