Back

Could not find a declaration file for module 'appwrite'.

  • 0
  • Web
Matteo G
18 May, 2023, 12:47

Hey all, I've been building a little something for the cloud hackaton, but it seems like the latest appwrite package doesn't provide types for typescript, which causes tsc to fail compilation. Is there a simple way to solve this ?

TL;DR
The user is encountering an error where a declaration file for the 'appwrite' module cannot be found. They are using Vite+React. The suggested solution is to check if there is a 'moduleResolution' in other 'tsconfig' files and update it to `"moduleResolution": "node"`. Another suggestion is to ensure the package version is '8.1.0' if working against Appwrite cloud. There is also a link provided for further assistance.
Binyamin
18 May, 2023, 12:54

Also, make sure you're using version 8.1.0 in case you're working against Appwrite cloud

Matteo G
18 May, 2023, 12:56

as in the package version ?

Binyamin
18 May, 2023, 12:57

Yes,

Matteo G
18 May, 2023, 13:01

doing both does not solve the error (ps: version is 8.0.1, 8.1.0 does not exist)

Binyamin
18 May, 2023, 13:03

Oh my bad I gave you the version for node it should be version 10.1.0

Binyamin
18 May, 2023, 13:03

What type of project you're working on? Vite+Vue, React?

Matteo G
18 May, 2023, 13:05

vite+react error is:

TypeScript
  There are types at '/node_modules/appwrite/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'appwrite' library may need to update its package.json or typings.```
Binyamin
18 May, 2023, 13:06

And you've update the "moduleResolution": "node",? and rerun it?

Matteo G
18 May, 2023, 13:07

yes

Binyamin
18 May, 2023, 13:10

Check if you have moduleResolution in other tsconfig files

Matteo G
18 May, 2023, 13:14

damn yeah, there was a second one xD

Matteo G
18 May, 2023, 13:14

thanks for the tip πŸ™‚

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more