dqbd / tiktoken

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

Cannot find module error #75

Open thdoan opened 8 months ago

thdoan commented 8 months ago

I'm using the sample code for Cloudflare Workers and got these errors in VS Code:

Cannot find module 'tiktoken/lite/init' or its corresponding type declarations.
Cannot find module './node_modules/tiktoken/lite/tiktoken_bg.wasm' or its corresponding type declarations.
Cannot find module 'tiktoken/encoders/cl100k_base.json' or its corresponding type declarations.

Code:

import { init, Tiktoken } from 'tiktoken/lite/init';
import wasm from './node_modules/tiktoken/lite/tiktoken_bg.wasm';
import model from 'tiktoken/encoders/cl100k_base.json';

I double-checked that ./node_modules/tiktoken does exist. Is there a step I'm missing?

ajayvignesh01 commented 3 months ago

did u end up figuring this out?