Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import - @bokuweb/zstd-wasm #602

Closed
Xyah3PBeHB opened this issue Apr 20, 2023 · 2 comments
Closed

Failed to import - @bokuweb/zstd-wasm #602

Xyah3PBeHB opened this issue Apr 20, 2023 · 2 comments
Labels
browser Not working in Browser

Comments

@Xyah3PBeHB
Copy link

Failing module

import { init } from "https://esm.sh/@bokuweb/zstd-wasm"
init()

Error message

After onload I got this:

Uncaught (in promise) Error: Dynamic require of "data:text/javascript,const data=await fetch('https://esm.sh/@bokuweb/[email protected]/dist/web/wasm/zstd.wasm').then(r=>r.arrayBuffer());export default new WebAssembly.Module(data)" is not supported
    at index.web.ts:7:2
    at index.web.ts:7:2
    at Generator.next (<anonymous>)
    at index.web.ts:7:2
    at new Promise (<anonymous>)
    at pe (index.web.ts:7:2)
    at Module.Be (index.web.ts:7:2)
    at <anonymous>:1:64

Additional info

  • esm.sh version: v115~
  • Browser version: Chromium 102
@Xyah3PBeHB Xyah3PBeHB added the browser Not working in Browser label Apr 20, 2023
@ije ije closed this as completed in 322db93 Apr 20, 2023
@ije
Copy link
Member

ije commented Apr 21, 2023

i fixed the dynamic require error, but you need to point out the wasm url (require wasm module doesn't work currently)

await init("https://esm.sh/@bokuweb/[email protected]/dist/esm/wasm/zstd.wasm");

@Xyah3PBeHB
Copy link
Author

i fixed the dynamic require error, but you need to point out the wasm url (require wasm module doesn't work currently)

await init("https://esm.sh/@bokuweb/[email protected]/dist/esm/wasm/zstd.wasm");

Now it throws this error.

index.web.ts:7 Uncaught (in promise) RangeError: WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.
    at index.web.ts:7:2
    at index.web.ts:7:2
    at index.web.ts:7:2
    at Generator.next (<anonymous>)
    at index.web.ts:7:2
    at new Promise (<anonymous>)
    at LA (index.web.ts:7:2)
    at vA (index.web.ts:7:2)
    at index.html:32:839

I tried downgrading the library version and PIN to an older esm.sh version and still getting this error, but I'm sure it was ok a month ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

2 participants