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
errors when bundling #217
Comments
The error is caused by Parcel using the ES module version of this library, i.e. it is adding the bignumber.mjs file to the bundle instead of the bignumber.js file. This can be seen by renaming the node_modules/bignumber.js/bignumber.mjs file before running node node_modules/parcel/bin/cli.js build -t node --no-minify --bundle-node-modules index.js in which case the bignumber.js file is instead bundled and everything is fine. worked Parcel exports the default export from the bignumber.mjs file as a named export, so if all the occurrences of |
This line in the Parcel source code shows that when it parses the bignumber.js/package.json it will use the file pointed to by the module field in preference to that of the main field, and this does not seem to be configurable. This means that the only way to solve this issue is for the module field to be removed from the bignumber.js/package.json. Do I want to do this because of the limitations of Parcel? |
First, thanks so much for taking a look! Being an OSS dev is often thankless... I'm here thanking you for the project itself and for looking. My guess is this will end up being a babel.js bug as both webpack and parcel suffer from the same problem here. |
Further investigation reveals that removing the For my reference, some notes and links: Bundlers like webpack and rollup seek to use the ES module version of a library as it improves static analysis and tree-shaking, though this library only has a single export so that may not offer much here. Parcel bundling seems to work okay irrespective of whether consumers use Bundlers grab the UMD bignumber.js file if there is no On the Links providing some rationale for currently having an extensionless |
thanks for this! |
I was running into the same errors as #199 and #166 . Also see issues at node-cbor too: hildjj/node-cbor#88
I created a very minimal setup that has the same problems: https://github.com/quorumcontrol/minimal-fail-bignumber
Running: https://github.com/quorumcontrol/minimal-fail-bignumber/blob/master/cbor-bignumber/showerror.sh
produces:
The text was updated successfully, but these errors were encountered: