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.

ReferenceError: TouchEvent is not defined

See original GitHub issue

TouchEvent is not always defined. Reported via Sentry. Doesn’t seem to be a crashing error.

ReferenceError: TouchEvent is not defined
  at value (/lib.min.js:35:75460)
  at l (/lib.min.js:1:8318)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
towerofnixcommented, Apr 14, 2018

Going to quote my (duplicate-of-this) issue:

The “bad” line follows:

https://github.com/LLK/scratch-gui/blob/fc388b63c89559c4f25d069db84b49912b7a77fc/src/containers/stage.jsx#L203

Any non-left click makes the second condition, e instanceof TouchEvent, run. According to the compatibility section for TouchEvent, it looks like TouchEvent is defined only on Windows systems. Yikes!

0reactions
regcolecommented, Sep 10, 2018

@paulkaplan @towerofnix @amazinigmech2418

To get this working (on FF at least) change the line to

   if (e.button === 0 || window.TouchEvent && e instanceof TouchEvent) {
Read more comments on GitHub >

github_iconTop Results From Across the Web

TouchEvent not working in firefox and other website browser
To get this work in FF, just add window.TouchEvent condition (is it defined):. if(window.TouchEvent && e.originalEvent instanceof TouchEvent){}.
Read more >
1693172 - TouchEvent is not always defined - Bugzilla@Mozilla
TouchEvent should always be defined, instead of only when touch simulation is enabled or a touch device is detected. This is the current...
Read more >
ReferenceError: TouchEvent is not defined - Configuration
When trying to tap_action: more-info on picture-entities I receive the following error in Firefox but works fine in iOS app and Chrome.
Read more >
KJS Wrappers: "ReferenceError: TouchEvent is not defined ...
KJS Wrappers: "ReferenceError: TouchEvent is not defined" caused by dom.events.TouchEvent. What steps will reproduce the issue?
Read more >
Publish: Mouse stuck in Graph view not working in Firefox
Stack trace of the error I get in the console. Uncaught ReferenceError: TouchEvent is not defined initGraphics https://publish.obsidian.md/app.
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