paulmillr / noble-hashes

Audited & minimal JS implementation of hash functions, MACs and KDFs.
https://paulmillr.com/noble
MIT License
573 stars 46 forks source link

Module not found: Error: Can't resolve './_assert' ... Did you mean '_assert.js'? #42

Closed ddresch closed 1 year ago

ddresch commented 1 year ago

When using

import { k12 } from '@noble/hashes/sha3-addons'

I ended up with the Module not found error. As a quick fix, I needed to change the file sha3-addons.js and add the .js file extension to the require statement. I'm writing this issue because I'm uncertain if this type of require without the extension is intentional or not.

paulmillr commented 1 year ago

That has been fixed in v1.1.1

ddresch commented 1 year ago

I'm using version 1.1.5, and it is importing _assert without .js extension.

I see this was changed in this commit: https://github.com/paulmillr/noble-hashes/commit/ea596c28d1896fa29fd87d1e75365b044191b07a

Using the npm package. If I check the published version 1.1.5 on npmjs.org you see the missing .js extension. https://www.npmjs.com/package/@noble/hashes?activeTab=explore

paulmillr commented 1 year ago

published 1.2.0