connor4312 / blake3

BLAKE3 hashing for JavaScript: native Node bindings (where available) and WebAssembly
https://connor4312.github.io/blake3/index.html
MIT License
177 stars 19 forks source link

Parcel compatibility #29

Open MyNewToken opened 3 years ago

MyNewToken commented 3 years ago

My code (inside an ES6 module) import load from 'blake3/browser-async'

Parcel warnings Could not load source file "../../ts/browser/wasm.ts" in source map of "node_modules/blake3/esm/browser/wasm.js". ⚠️ Could not load source file "../../ts/browser/index.ts" in source map of "node_modules/blake3/esm/browser/index.js". ⚠️ Could not load source file "../../ts/browser/index.ts" in source map of "node_modules/blake3/esm/browser/index.js". ⚠️ Could not load source file "../../ts/browser/wasm.ts" in source map of "node_modules/blake3/esm/browser/wasm.js". ⚠️ Could not load source file "../../ts/base/index.ts" in source map of "node_modules/blake3/esm/base/index.js". ⚠️ Could not load source file "../../ts/browser/hash-instance.ts" in source map of "node_modules/blake3/esm/browser/hash-instance.js". ⚠️ Could not load source file "../../ts/browser/hash-fn.ts" in source map of "node_modules/blake3/esm/browser/hash-fn.js". ⚠️ Could not load source file "../../ts/base/hash-instance.ts" in source map of "node_modules/blake3/esm/base/hash-instance.js". ⚠️ Could not load source file "../../ts/base/hash-reader.ts" in source map of "node_modules/blake3/esm/base/hash-reader.js". ⚠️ Could not load source file "../../ts/base/hash-fn.ts" in source map of "node_modules/blake3/esm/base/hash-fn.js". ⚠️ Could not load source file "../../ts/base/disposable.ts" in source map of "node_modules/blake3/esm/base/disposable.js". ⚠️ Could not load source file "../../ts/browser/encoding.ts" in source map of "node_modules/blake3/esm/browser/encoding.js". ⚠️ Could not load source file "../../ts/browser/hash-reader.ts" in source map of "node_modules/blake3/esm/browser/hash-reader.js". ⚠️ Could not load source file "../../ts/browser/hash.ts" in source map of "node_modules/blake3/esm/browser/hash.js". ⚠️ Could not load source file "../../ts/browser/hash-instance.ts" in source map of "node_modules/blake3/esm/browser/hash-instance.js". ⚠️ Could not load source file "../../ts/base/index.ts" in source map of "node_modules/blake3/esm/base/index.js". ⚠️ Could not load source file "../../ts/browser/hash-fn.ts" in source map of "node_modules/blake3/esm/browser/hash-fn.js". ⚠️ Could not load source file "../../ts/base/hash-fn.ts" in source map of "node_modules/blake3/esm/base/hash-fn.js". ⚠️ Could not load source file "../../ts/base/hash-reader.ts" in source map of "node_modules/blake3/esm/base/hash-reader.js". ⚠️ Could not load source file "../../ts/browser/encoding.ts" in source map of "node_modules/blake3/esm/browser/encoding.js". ⚠️ Could not load source file "../../ts/browser/hash-reader.ts" in source map of "node_modules/blake3/esm/browser/hash-reader.js". ⚠️ Could not load source file "../../ts/browser/hash.ts" in source map of "node_modules/blake3/esm/browser/hash.js". ⚠️ Could not load source file "../../ts/base/hash-instance.ts" in source map of "node_modules/blake3/esm/base/hash-instance.js".

Browser console Uncaught SyntaxError: Cannot use 'import.meta' outside a module Coming from app. ... .js file generated by Parcel function init(module) { if (typeof module === 'undefined') { module = import.meta.url.replace(/\.js$/, '_bg.wasm'); } ...

I am a bit of a JS noob, so any help would be greatly appreciated.