You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, types are generated using ESM config but, unlike the files in dist/esm, do not have a parent package.json file with type: module. Hence, the types are considered CJS and cause typechecking errors when a consumer enables lib checking in their tsconfig.json.
To Reproduce
Set skipLibCheck: false in a consuming package and import from @bufbuild/connect. Since that imports from @bufbuild/protobuf (which has the types exported as ESM), you'll get the following error (and many others like it):
node_modules/@bufbuild/connect/dist/types/router.d.ts(1,46): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@bufbuild/protobuf")' call instead.
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently, types are generated using ESM config but, unlike the files in
dist/esm
, do not have a parentpackage.json
file withtype: module
. Hence, the types are considered CJS and cause typechecking errors when a consumer enables lib checking in theirtsconfig.json
.To Reproduce
Set
skipLibCheck: false
in a consuming package and import from@bufbuild/connect
. Since that imports from@bufbuild/protobuf
(which has the types exported as ESM), you'll get the following error (and many others like it):The text was updated successfully, but these errors were encountered: