-
Notifications
You must be signed in to change notification settings - Fork 22
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 #41
Comments
can you please confirm that all of versions bellow work in an electron enviroment ? const Bignumber = require('bignumber.js').default
const {Bignumber} = require('bignumber.js')
const Bignumber = require('bignumber.js').BigNumber |
|
do you know what |
I'm not sure what the default is. Right now, my webpack.config.js file is completely empty, if that helps. I will be looking more closely at this later on... will report back with any findings |
@olizilla can you help with this? Webpack with electron doesn't follow browser > module> main by default? |
I am facing the same issue in an almost brand new project. Using electron, vue-cli and ipfs-js. It's very easy to reproduce this issue.
|
Also encountering this issue, part of an IPFS-related package...seems to affect webpack in general |
Closes dignifiedquire#41 (cherry picked from commit 6190338)
hi I am still facing this issue |
When using borc in an electron webpack app, I am getting the error
TypeError: Bignumber is not a constructor
.When inspecting
Bignumber
with console.log inconstants.js
, I noticed this:I changed this line:
borc/src/constants.js
Line 3 in b14a317
From this:
to this:
I did the same thing here:
borc/src/encoder.js
Line 7 in b14a317
I am pretty new to electron and webpack and not sure why I had to do this, but perhaps changing the code for compatibility would be good for others creating electron apps or using tools similar to webpack. Or, some guidance on how I can avoid these errors would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: