The error
Could not find a declaration file for module 'appwrite'. 'c:/Users/ASUS/OneDrive/Desktop/my-vue-app/node_modules/appwrite/dist/esm/sdk.js' implicitly has an 'any' type.
There are types at 'c:/Users/ASUS/OneDrive/Desktop/my-vue-app/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.
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
Why can't ts deted the types in appwrite?
If the tsconfig has moduleResolution: "bundler"
it doesn't support appwrite types
So if you change it to node
, it works?
What version of the Appwrite SDK did you install?
Would you be able to create a GitHub issue for this?
sure :)
Yes works like a charm
11.0.0
Thanks. After googling a bit it seems like this might be a newer typescript config and we can get it to work if we update a few things in the sdk. Thanks so much for bringing this to our attention! 🙏
lemme know if I can drop a PR for this?
Sorry, I just did: https://github.com/appwrite/sdk-generator/pull/653
hehe its ok :)
The issue getting solved is more important, thanks :)
Recommended threads
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...