Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Decimal is not a constructor #1

Open
foundryspatial-duncan opened this issue Jan 19, 2021 · 1 comment
Open

TypeError: Decimal is not a constructor #1

foundryspatial-duncan opened this issue Jan 19, 2021 · 1 comment

Comments

@foundryspatial-duncan
Copy link

I just installed this package to use it for number formatting in a chart, but I get this fatal error when I try to use it. (even scino(12345) throws this error)

TypeError: Decimal is not a constructor

Some info from yarn why decimal.js shows it's version 7.5.1:

=> Found "decimal.js@7.5.1"
info Reasons this module exists
   - "scino" depends on it
   - Hoisted from "scino#decimal.js"

And the package I'm using is scino@1.0.2

@foundryspatial-duncan
Copy link
Author

I think it's caused by the way webpack is resolving dependencies. (see: webpack/webpack#4742 for related info)
It expects there to be a .default where scino importing the default export from decimal.js ... I dunno what the solution would be, short of providing an ES module version of scino. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant