botisan-ai / gpt3-tokenizer

Isomorphic JavaScript/TypeScript Tokenizer for GPT-3 and Codex Models by OpenAI.
MIT License
171 stars 19 forks source link

Repair Compatibility issue with Rollup Bundler. #5

Closed jonwardopenai closed 2 years ago

jonwardopenai commented 2 years ago

The Rollup Bundler requires a path to an existing module file.

Otherwise you encounter the following error:

[commonjs--resolver] Failed to resolve entry for package "gpt3-tokenizer". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "gpt3-tokenizer". The package may have incorrect main/module/exports specified in its package.json.
    at packageEntryFailure (/node_modules/vite/dist/node/chunks/dep-1513d487.js:34405:11)
    at resolvePackageEntry (/node_modules/vite/dist/node/chunks/dep-1513d487.js:34402:5)
    at tryNodeResolve (/node_modules/vite/dist/node/chunks/dep-1513d487.js:34160:20)
    at Object.resolveId (node_modules/vite/dist/node/chunks/dep-1513d487.js:33962:28)
    at /node_modules/rollup/dist/es/shared/rollup.js:22694:37
lhr0909 commented 2 years ago

Thanks! @jonwardopenai merged and released v1.1.3