-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Big is not a function error #1363
Comments
Some investigation .... Running the Chrome debugger and pausing at this line I see ...
but running the function
Which is a very strange debug trace ? Almost as if Big is being redefined somewhere? |
More investigation ...
But after the requires its defined as the result of the require. Replacing the call in stats.js to Big(0) by Big.Big(0) works, I notice on the big repository that it was changed 10 hours ago to change exports big.mjs so I'm guessing that is the problem. |
Workaround for now is to set in package.json : dependencies { "big.js": "5.0.3" } Since the fix that broke this was today, the "Big" package might get fixed quickly, otherwise it may need to force that precise version in ipfs-bitswap and anywhere else its used. |
It was apparently fixed in $ npm ls big.js
ipfs@0.28.2 /Users/alan/Code/protocol-labs/js-ipfs
├── big.js@5.1.1
├─┬ interface-ipfs-core@0.65.9
│ └── big.js@5.1.1 deduped
├─┬ ipfs-api@21.0.0
│ └── big.js@5.1.1 deduped
├─┬ ipfs-bitswap@0.20.0
│ └── big.js@5.1.1 deduped
├─┬ ipfs-repo@0.20.0
│ └── big.js@5.1.1 deduped
├─┬ ipfsd-ctl@0.34.0
│ └─┬ ipfs-repo@0.19.0
│ └── big.js@5.1.1 deduped
├─┬ ipld@0.17.0
│ └─┬ ipfs-repo@0.19.0
│ └── big.js@5.1.1 deduped
├─┬ libp2p@0.20.4
│ └─┬ libp2p-switch@0.39.2
│ └── big.js@5.1.1 deduped
└─┬ transform-loader@0.2.4
└─┬ loader-utils@1.1.0
└── big.js@3.2.0 |
Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](webpack/webpack#4742) Fixes #1363 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](webpack/webpack#4742) Refs ipfs/js-ipfs#1363 Note that this solves the issue for `big.js`, but also for any other modules in the future that decide to define a `module` field in their `package.json` or any that already do and we just haven't realised it yet! License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Thanks - looks like it worked. |
Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](webpack/webpack#4742) Fixes #1363 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](webpack/webpack#4742) Refs ipfs/js-ipfs#1363 Note that this solves the issue for `big.js`, but also for any other modules in the future that decide to define a `module` field in their `package.json` or any that already do and we just haven't realised it yet! License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](webpack/webpack#4742) Refs ipfs/js-ipfs#1363 Note that this solves the issue for `big.js`, but also for any other modules in the future that decide to define a `module` field in their `package.json` or any that already do and we just haven't realised it yet! License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Linux wwwb-dev0.fnf.archive.org 4.4.0-45-generic fix - module not found #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux and on OSX
Type: Bug
Severity: Critical
Description:
After clearing out my node_modules to do a fresh install, I'm seeing a crash
Steps to reproduce the error:
The rough build procerss was:
Its happening with my repo dweb-transports, and I don't currently have a workaround since this is deep in the IPFS code.
The text was updated successfully, but these errors were encountered: