palerdot / react-d3-speedometer

React Speedometer component using d3.js ⚛️
https://palerdot.in/react-d3-speedometer/
MIT License
232 stars 58 forks source link

Unexpected identifier "baseGetTag " #72

Closed laitanop closed 4 years ago

laitanop commented 4 years ago

I installed with "yarn" when I import ReactSpeedometer, it shows this error.

Captura de Pantalla 2020-04-08 a la(s) 11 23 19
palerdot commented 4 years ago

can you share a reproducible code sandbox or something?

palerdot commented 4 years ago

@laitanop or maybe something like a reproducible repo where I can check this issue ... thanks ...

palerdot commented 4 years ago

Here is a codesandbox link where it works fine - https://codesandbox.io/s/stoic-hooks-rjcvu?file=/src/App.js

palerdot commented 4 years ago

My guess is that your build system does not understand es6 module identifiers like import/export ... , Almost all of the react app templates, for eg: create-react-app will support this out of the box ... I can share an example repo created with create-react-app where things are working

palerdot commented 4 years ago

My guess is that your build system does not understand es6 identifiers like import/export ... , Almost all of the react app templates, for eg: with [create-react-app](https://github.com/facebook/create-react-app) will support this out of the box ... I can share an example repo created with create-react-app where things are working

@laitanop To verify this, you can downgrade to 0.10.x and see if it works fine. Because in v0.11.0, the library moved to lodash-es from lodash as former provides tree shaking resulting in smaller bundle sizes in your final app bundle. You can see the CHANGELOG for more details. If that is the case, you might want to upgrade your app bundling to support es6 module code imports ...

palerdot commented 4 years ago

I'm closing this issue since this seems like a problem around the bundling setup of the project, and not the library itself. Please reopen if you find issues with the library itself.

jamneck commented 4 years ago

I'm closing this issue since this seems like a problem around the bundling setup of the project, and not the library itself. Please reopen if you find issues with the library itself.

I encountered the same issue on a project started with create-next-app. Downgrading to 0.10.x resolved the issue.

Thanks for the good work.

palerdot commented 4 years ago

ok ... Alternatively you can use babel to make your bundling process understand es6 modules out of the box, so that you can keep using libraries like lodash-es that export es6 modules ...