I'm running a simple method in my code, and running into a strange error after moving to the latest library version 4.0.0
const data = 'hello world!';
const hash = await Hash.of(data);
ReferenceError: TextEncoder is not defined
at Object.of (node_modules/ipfs-only-hash/index.js:13:5)
If I pass in a buffer as I originally needed, I get:
Content was invalid
79 | const data = 'hello world!';
80 |
> 81 | const hash = await Hash.of(Buffer.from(data));
I've verified I'm using the latest version. From my package-lock.json file:
I'm running a simple method in my code, and running into a strange error after moving to the latest library version 4.0.0
If I pass in a buffer as I originally needed, I get:
I've verified I'm using the latest version. From my package-lock.json file: