Comments (9)
I have safe-buffer, which looking at the index.js inside safe-buffer, "it" is trying to require buffer
which isn't in my node_modules.
This also confirms that cjs is the correct transform. thanks.
from bip39.
@thatsbrandon This question is better asked on a webpack forum/issue.
I do remember faintly that latest webpack requires some extra configuration to include Buffer.
from bip39.
@junderw Thank you! I ended up looking into this extra configuration for Buffer in webpack & I found the solution which was to create my own resolve.fallback
polyfill. I got my extension to compile a run without an issue
from bip39.
@NullVoxPopuli what issues are you experiencing specifically?
This project does work if you use browserify
or web-pack or the like.
from bip39.
I'm actually trying not to use browserify (feels hacky), webpack (personal vendetta), and am using rollup and broccoli.
if I just try to load the module directly: node_modules/bip39/index.js
I get this error when my app boots (breaking all the things / not even rendering a page):
Could not find module `safe-buffer` imported from `(require)`
(same error happens when I try an amd transform on it)
if I do a common-js transform on it, my app loads, and then I get this error when I import
the module:
Error: Could not find module `buffer` imported from `bip39`
TypeError: Cannot read property 'exports' of undefined
I have a unit test that file that only has:
import * as bip from 'bip39';
console.log(bip);
from bip39.
@NullVoxPopuli this isn't an issue of this module.
We have safe-buffer
listed as a dependency in our package.json
:
Line 30 in bafbcd3
The tools are what you need to fix 👍
from bip39.
@NullVoxPopuli you'll need to add Buffer
to your bundling setup.
OOI, why do you think browserify is "hacky"?
from bip39.
@dcousens Do you have any links as to where I can add Buffer
to my webpack build, I'm, new to webpack?
from bip39.
@dcousens the problem is that browserify "does what it needs to" to make "the build work" giving no cares for bundle size. polyfill node builtins bloats the output JS a ton.
Here is a < 100 line version of bip39(ish), using native browser APIs: https://github.com/NullVoxPopuli/emberclear/blob/31c2807ade0f09da1ace435b0a90267c3b2bddd3/client/web/addons/crypto/addon/workers/crypto/utils/mnemonic.ts
(ish) = I haven't tested against bip39, and don't need to for that specific app
from bip39.
Related Issues (20)
- Duplicated word
- bip39 seems to be undefined in 3.+ versions HOT 1
- Why doesn't the address console HOT 1
- Recovery using only the first four letters of each word HOT 1
- Upgrade deps HOT 1
- Runtime errors HOT 1
- Function to convert entropy to seed? HOT 3
- Not work with rollup? HOT 1
- DevTools failed to load source map: Could not load content for file:///.../github/iancoleman/bip39/bootstrap.css.map: System error: net::ERR_FILE_NOT_FOUND HOT 1
- v3.0.4 is not working, v3.0.3 is fine HOT 2
- Invalid argument(s): Invalid mnemonic HOT 3
- ESM module support HOT 6
- Use more lightweight sha256 implementation HOT 6
- the testing is wrong!! HOT 1
- Electron + angular : how to unit test? HOT 3
- Serbian bip39 list HOT 1
- Error while using bip39.generateMnemonic(128) in react native HOT 3
- using bip39.generateMnemonic() is secure? HOT 1
- does it create a unused wallet everytime? HOT 1
- Bip39.ValidateMnemonic() always returns false in react HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bip39.