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

Invalid cache hit for WASM - @dqbd/tiktoken #552

Closed
dqbd opened this issue Mar 19, 2023 · 5 comments
Closed

Invalid cache hit for WASM - @dqbd/tiktoken #552

dqbd opened this issue Mar 19, 2023 · 5 comments
Labels
deno Not working in Deno

Comments

@dqbd
Copy link

dqbd commented Mar 19, 2023

Failing module

fetch("https://esm.sh/v111/@dqbd/tiktoken@1.0.2/tiktoken_bg.wasm").then(a => a.arrayBuffer()

Error message

The package @dqbd/tiktoken includes 2 WASM binaries (./tiktoken_bg.wasm and ./lite/tiktoken_bg.wasm) and esm.sh returns only the second WASM file regardless of URL.

Expected

https://esm.sh/v111/@dqbd/tiktoken@1.0.2/tiktoken_bg.wasm -> ./tiktoken_bg.wasm
https://esm.sh/v111/@dqbd/tiktoken@1.0.2/lite/tiktoken_bg.wasm -> ./lite/tiktoken_bg.wasm

Actual

https://esm.sh/v111/@dqbd/tiktoken@1.0.2/tiktoken_bg.wasm -> ./lite/tiktoken_bg.wasm
https://esm.sh/v111/@dqbd/tiktoken@1.0.2/lite/tiktoken_bg.wasm -> ./lite/tiktoken_bg.wasm

Additional info

  • esm.sh version: v111
  • Deno version: 1.29.1
@ije
Copy link
Member

ije commented Mar 19, 2023

seems it imports .wasm in js directly, currently the server can not handle it correctly.

@ije
Copy link
Member

ije commented Mar 19, 2023

Screenshot 2023-03-20 at 07 51 18

@dqbd
Copy link
Author

dqbd commented Mar 20, 2023

The issue here is that I'm attempting to download WASM files via fetch and I'm getting wrong WASM files served from CDN.

https://esm.sh/v111/@dqbd/tiktoken@1.0.2/tiktoken_bg.wasm should not be the same file as https://esm.sh/v111/@dqbd/tiktoken@1.0.2/lite/tiktoken_bg.wasm

@dqbd
Copy link
Author

dqbd commented Mar 20, 2023

Maybe I'm mistaken here, but it shouldn't matter if .wasm imports in JS directly or not, the server should serve proper assets?

@ije
Copy link
Member

ije commented Mar 20, 2023

@ije ije closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno Not working in Deno
Projects
None yet
Development

No branches or pull requests

2 participants