-
-
Notifications
You must be signed in to change notification settings - Fork 73
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: bignumber is not a constructor, nodejs webpack bundle #88
Comments
can you put together a small webpack example that would let me recreate this on my own system? That might help me on #87 anyway. |
I'm having this problem using parcel too |
Are you bundling bignumber.js (https://github.com/MikeMcl/bignumber.js)? |
Thanks for the quick response. I put together a minimal failure case https://github.com/quorumcontrol/minimal-fail-bignumber/tree/master/cbor-bignumber It does seem unrelated to node-cbor (as ipld has it too). Seems bignumber has been having issues like this: https://github.com/MikeMcl/bignumber.js/issues/166 and MikeMcl/bignumber.js#199 which produces:
|
Based on your repro, I think that if I change to this it will work in both environments at the moment: const bignumber = require('bignumber.js').BigNumber |
Yes, that seemed to work, both in node as well as in the parcel version (after I updated the version number to force whatever cache parcel was using to be refreshed). I'm going to commit this, and study the CI run carefully. |
There is also a change happening at bignumber: parcel-bundler/parcel#2581 (comment) |
Nod. With a clean CI run for node (https://travis-ci.org/hildjj/node-cbor/builds/485581442) I propose to do a release at this point so others can check if this fixes their issue, then carefully monitor the above thread for a resolution, carefully backing this out as needed when I take the next bignumber.js version. Any concerns @tobowers ? And, btw, thank you SO much for the clean repro. |
No concerns from me. Thanks! |
Done. Look for |
Seeing no further comments, let's mark this as done. |
In a nodejs app bignumber.js throws in initialization.
bignumber version is 6.0.0, required by:
bignumber is used in a webpack bundle, on node version is LTS 8.12.0, inside a docker container with image node:8.12.0-alpine in an ubuntu server host.
The code referenced by the stack is:
Any help and how to fix the issue would be greatly appreciated!
The text was updated successfully, but these errors were encountered: