TouchEvent is not defined error on module import
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior When importing NgxGraphModule I get a ReferenceError in Firefox. There was no error when using ngx-graph 5.0.1.
Reproduction of the problem
import { NgxGraphModule } from '@swimlane/ngx-graph';
@NgModule({
imports: [
...
NgxGraphModule,
],
})
export class MyModule {}

Please tell us about your environment:
- ngx-graph version: 5.1.0
- Angular version: 6.0.6
- Browser: [ Firefox 60 ]
- Language: [ TypeScript 2.7.2 ]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:15 (3 by maintainers)
Top 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 >angular/angular-cli - Gitter
Then ng test would say error: Can not load ... the error in firefox and safari 'ReferenceError: TouchEvent is not defined' ... did...
Read more >SPFx. Error while importing modernizr in SPFx
It seems like modernizr script from the CDN does not contain any modules. Try to use SPComponentLoader. import { SPComponentLoader } from ...
Read more >vue2-touch-events - npm
import Vue from 'vue' import Vue2TouchEvents from 'vue2-touch-events' ... Use touch event only, will not trigger click event.
Read more >Find replacement for Modernizr touchevent test and deprecate
I propose building on the existing logic in core/misc/modernizr-additional-tests.es6.js . This is in core because Modernizr itself has ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This issue is fixed in version 5.1.1
I am also getting the same issue. Any one have a workaround so solved this