dqbd / tiktoken

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

[BUG] library works in test, but fails in dev server #55

Open dhruv-anand-aintech opened 1 year ago

dhruv-anand-aintech commented 1 year ago

I get this error when trying to run my typescript server with yarn dev, and sending a request to it:

✖ LinkError: WebAssembly.Instance(): Import #2 module="./tiktoken_bg.js" function="__wbg_stringify_029a979dfb73aa17" error: function import requires a callable
      at ../../tiktoken/tiktoken.cjs 
dqbd commented 11 months ago

Hello @dhruv-anand-aintech!

This does seem like the WASM import is mangled, would it be possible to share a reproducible example?