matomo-nodejs-tracker
matomo-nodejs-tracker copied to clipboard
Fails to build when imported in Create React App
I ran into this build error deploying to heroku once I added this tracker:
Failed to minify the code from this file:
./node_modules/matomo-tracker/index.js:96
Read more here: http://bit.ly/2tRViJ9
I just copied the code into my src
directory for now, but would be nice if this package was published pre-compiled.
Hi, I guess this is because the module uses ES5/6 syntax, so if your client doesn't support is, you need to use something like babel to transpile it.
But nevertheless this module is just intended for nodejs, which should support the syntax. If you want to track Matomo in the browser in a react app, I guess it is easier if you use a library that is intended for it like (I didn't test them) https://github.com/joernroeder/piwik-react-router https://www.npmjs.com/package/react-piwik
I have no problem with a recent create-react-app, so I guess you can close this one.