palerdot/react-d3-speedometer

import baseGetTag from './_baseGetTag.js';

Closed this issue · 1 comments

Cannot use import statement outside a module
/project/node_modules/lodash-es/isNumber.js:1
import baseGetTag from './_baseGetTag.js';

This happens because the build setup of the project does not understand es6 modules (keywords like import, export) ... There are two solutions ...

  • you can stick with 0.10.x by pinning your dependency since it is using lodash commonjs build. From 0.11.x, react-d3-speedometer is using lodash-es since it will result in reduced final bundle size for your app.
  • The better way is make changes to your build setup by including babel (like using preset env) which will recognize es6 modules. This will be done by default in almost all react setup like create react app.

I"m closing this issue since this is a problem with the bundling setup of the project.