qooxdoo-archive / qooxdoo-cli

(deprecated, moved into qooxdoo-compiler) qx commandline
MIT License
4 stars 5 forks source link

"Cannot read property 'Pointer' of undefined" #15

Closed mbgonicus closed 7 years ago

mbgonicus commented 7 years ago

Hi,

we are using the cli tool with qx compile --watch for a new project. When reloading the application we often get this error:

TypeError: Cannot read property 'Pointer' of undefined
    at wrapper._fireEvent (http://localhost:3000/source/transpiled/qx/event/handler/Pointer.js:176:29)
    at wrapper._onPointerEvent (http://localhost:3000/source/transpiled/qx/event/handler/Pointer.js:202:14)
    at HTMLDocument.<anonymous> (http://localhost:3000/source/transpiled/qx/lang/Function.js:294:25)

The line in question is:

qx.event.type.dom.Pointer.normalize(domEvent);

I estimate it happens every other reload, but sometimes it happens multiple reloads in a row and then we can reload it for like five times and don't get an error. So it is really seems to appear random.

Is someone having this issue too?

johnspackman commented 7 years ago

Please can you try editing qx/event/handler/Pointer.js and changing the class comment to include @require(qx.event.type.dom.Pointer), eg the class should start like this:

/**
 * Unified pointer event handler.
 * @require(qx.event.dispatch.DomBubbling)
 * @require(qx.event.type.Pointer) // load-time dependency for early native events
 * @require(qx.event.type.dom.Pointer)
 */
qx.Class.define("qx.event.handler.Pointer",
{
  extend : qx.event.handler.PointerCore,
mbgonicus commented 7 years ago

Hi, thanks for the fast reply! I added that require line and will observe if the error appears again.

mbgonicus commented 7 years ago

That actually solved it, thank you very much!

How do we deal with this? Shall I prepare a PR for the main qooxdoo repo?

johnspackman commented 7 years ago

no leave it with me, I'll put it in with a PR Im preparing for a couple of similar issues. Glad it's fixed it for you!