matomo-org / matomo-nodejs-tracker

A Node.js wrapper for the Matomo (Piwik) tracking HTTP API
MIT License
117 stars 41 forks source link

Fails to build when imported in Create React App #51

Open turpana opened 6 years ago

turpana commented 6 years ago

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.

Findus23 commented 6 years ago

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

Toub commented 4 years ago

I have no problem with a recent create-react-app, so I guess you can close this one.