Closed Lalit3716 closed 1 year ago
I found this issue when working on something for the ongoing appwrite hackathon π and I know how to fix it as well but I am not sure where to open the PR since this is a READ ONLY repository.
@Lalit3716 do you have a way to patch this for the time being? running into this issue as well and id love work around
Yeah for the time being I manually edit node_modules/appwrite/package.json
to remove exports
field.
Closing as a duplicate of https://github.com/appwrite/sdk-for-web/issues/54
π Reproduction steps
1) Initialize a TypeScript project with
moduleResolution: "bundler"
in yourtsconfig
. 2) Installappwrite
web sdk. 3) Try to import it you will see that for the sdk, types will be undefined.This is due to the fact that for TypeScript to work with packages that have
exports
field when using the newmoduleResolution: node16/nodenext/bundler
settings. When those are not used then TypeScript just ignorespackage.json#exports
- but when you make it aware ofexports
by using those options then it requires the types to be included inexports
and not as the top-level key ofpackage.json
.You can also visit this tool to check that the types for this sdk are definitely wrong: https://arethetypeswrong.github.io/.
π Expected behavior
Types should be well defined.
π Actual Behavior
Types aren't well defined with
moduleResolution: "bundler"
option on in yourtsconfig.json
.π² Appwrite version
Version 0.10.x
π» Operating system
Linux
𧱠Your Environment
No response
π Have you spent some time to check if this issue has been raised before?
π’ Have you read the Code of Conduct?