Closed benschac closed 6 months ago
Additionally, also probably worth testing on other popular build envs like
can you double check if window is undefined?
window is here.
The issue is that entropy-js
has a requirement on a nodejs module fs
that is not available in the client.
I had to polyfill it here: https://github.com/entropyxyz/entropy-client/commit/c6618c07a6bd55d7edc923350c5c66f18018693e#diff-0f913df15d01006c7733a9e4969f6335577a8a1ca3e1669c0013f57361c9ba7bR56
which, both adds more to the bundle, and is an additional step for someone building on the browser, that should be avoided.
https://developer.mozilla.org/en-US/docs/Web/API/File - which can handle fs
functionality for a client sdk.
After importing and console.log'ing the entropy instance, I'm getting this error:
As a third party dev, I'd assume either:
An option would be to polyfill
fs
but the package is already kind big #232PR with to reproduce: https://github.com/entropyxyz/entropy-client/pull/112
local env: