microsoft / TypeChat

TypeChat is a library that makes it easy to build natural language interfaces using types.
https://microsoft.github.io/TypeChat/
MIT License
8.06k stars 378 forks source link

typechat 0.1.0 not found #227

Closed Githamza closed 2 months ago

Githamza commented 3 months ago

After installing new 0.1.0 typechat version I'm getting this error

1 import { createLanguageModel, createJsonTranslator, Success } from "typechat";

==> Cannot find module 'typechat' or its corresponding type declarations.ts(2307)

I have it inside node_modules :

image

I think there is not an index.d.ts file

DanielRosenwasser commented 3 months ago

Is it possible that you are using "module": "commonjs"? If so, you'll need to switch to "module": "node16" or "nodenext".

The reason is that TypeChat takes advantage of subpath exports instead of using a single main field, whereas the older "commonjs" setting doesn't actually factor that in.