auduno/clmtrackr

jsfeat module is not defined

Opened this issue · 5 comments

Omi0 commented

While loading your example I am seeing following error in console:
Uncaught ReferenceError: module is not defined
Referencing to jsfeat module. Do you experience the same issue?

I have this issue when loading clmtrackr through webpack. This error shows when the start() function is called.

flut1 commented

In webpack as a workaround you may want to try loading clmtrackr as an UMD module. Instead of importing from clmtrackr, import from clmtrackr/build/clmtrackr. Also add to your webpack config:

module: {
  noParse: /build\/clmtrackr/,
}

This is an issue when trying to load clmtrackr in Angular(8) as well. Any suggestions?

This is an issue when trying to load clmtrackr in Angular(8) as well. Any suggestions?

Yes, that is an error from Angular 7+. I made an implementation, but for solve this specific error you need edit the angular.json file and add the module like "commonJS" like this:

"scripts": [ "node_modules/clmtrackr/build/clmtrackr.js" ]

And then you load it in a TS file (like a component) like this:

declare var clm: any;

Any plans to fix how the module exports are defined?