Back

[SOLVED] Cannot find name 'Account'. Did you mean 'account'?

  • 0
  • Web
1AR
2 Aug, 2023, 17:45

I am trying to get started with appwrite + react&typescript, But having big problems with getting going basically I am encountering THe same issue as in this https://github.com/appwrite/sdk-for-web/issues/54

Apparently there is a workaround in there and I have tried it, but it does not resolve the problem, (I am instead getting a diffrent error) Cannot find name 'Account'. Did you mean 'account'?ts(2552) appwrite.ts(9, 13): 'account' is declared here.

Any idea how to resolve this, or implementing a fix for my "new" problem?

TL;DR
User encountered the error "Cannot find name 'Account'. Did you mean 'account'?" while trying to set up Appwrite with React & TypeScript. They tried workarounds provided in a GitHub issue but still faced an issue. The solution was to add "export default client;" at the end of the file.
Drake
2 Aug, 2023, 17:59

what's your code?

Drake
2 Aug, 2023, 18:00

Cannot find name 'Account'. Did you mean 'account'?

1AR
2 Aug, 2023, 18:00
1AR
2 Aug, 2023, 18:00

To test and learn the auth

Drake
2 Aug, 2023, 18:01

and you installed the dependencies using the package.json in that repo?

1AR
2 Aug, 2023, 18:01

So basically i Have just done create vite npm add appwrite npm install

1AR
2 Aug, 2023, 18:02

yup

Drake
2 Aug, 2023, 18:02

actually here isn't one..

1AR
2 Aug, 2023, 18:02

yeahj it is just adding appwrite in the getting started section of the readme

Drake
2 Aug, 2023, 18:02

can you try restarting your IDE?

1AR
2 Aug, 2023, 18:03

Did it now , also previously, no change

1AR
2 Aug, 2023, 18:04

Though to start, I did get the error describedin the linked github issue, I then tried both the workarounds listed in the issue, ie. modifying the exports for appwrite and also, the change moduleResolution

1AR
2 Aug, 2023, 18:05

I am an idiot, somehow i was missing the last line of the file

1AR
2 Aug, 2023, 18:05

export default client;

1AR
2 Aug, 2023, 18:06

so with the fix from github issue + the actual correct code it works :-p

1AR
2 Aug, 2023, 18:06

Thank you very much 🙂

Drake
2 Aug, 2023, 18:06

[SOLVED] Cannot find name 'Account'. Did you mean 'account'?

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