dqbd / tiktoken

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

Will there be support for React? #19

Closed Hayakii closed 1 year ago

Hayakii commented 1 year ago

Will there be support for React? It doesn't seem possible on the tiktoken@1.0.0-alpha.3 version. Or maybe I don't understand how to use it? I'm not very familiar with coding, I'm doing a small project to improve myself

dqbd commented 1 year ago

Hello, React should be supported, but most likely you need to configure your bundler to support WASM ESM proposal.

@Hayakii May I ask what are you using to bundle your React app (Vite, CRA, Next.js)?

dqbd commented 1 year ago

As far as you are using Vite or Next.js, the support should be there with appropriate configuration changes.

For CRA, please follow progress at #21