.replace is not a function #909
-
Trying to figure out if this is a bug or just my lack of experience. I'm currently developing a project that utilizes ethers.js which uses bn.js as a dependency. So far I've only imported the library into one of my files and receive the following error attempting to run with
I think I've narrowed it down to being an issue with WMR instead of ethers, but as to what specific component is failing I'm not too sure. Any insight would be greatly appreciated. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The error comes from WMR's module resolution: wmr/packages/wmr/src/plugins/npm-plugin/resolve.js Lines 10 to 17 in 9a6777f
{
"browser": {
"buffer": false
}
}
I'll have to poke around a bit. Edit: Some closer reading of the field spec and |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! I'll be tracking on the issue as best I can follow. 😁 |
Beta Was this translation helpful? Give feedback.
The error comes from WMR's module resolution:
wmr/packages/wmr/src/plugins/npm-plugin/resolve.js
Lines 10 to 17 in 9a6777f
It looks like this might be upstream issue inresolve.exports
, or perhapsbn.js
is using an invalid configuration of the (very loose)"browser"
field spec.entry
gets resolve to{ buffer: false }
, which obviously isn't a module (and th…