dqbd / tiktoken

JS port and JS/WASM bindings for openai/tiktoken
MIT License
649 stars 49 forks source link

Crash in Cloudflare Workers / Vercel Edge Runtime #20

Closed dqbd closed 1 year ago

dqbd commented 1 year ago

When running the edge function via workerd or on live Vercel Edge Function, the following panic occurs:

Error: `unwrap_throw` failed
    at (node_modules/@dqbd/tiktoken/lite/tiktoken_bg.js:374:0)
    at (wasm://wasm/0030beca:1:462682)
    at (wasm://wasm/0030beca:1:430867)
    at (wasm://wasm/0030beca:1:14978)
    at (node_modules/@dqbd/tiktoken/lite/tiktoken_bg.js:195:0)

The issue does not occur when encode() is not invoked.

dqbd commented 1 year ago

Fixed in 1.0.2