Back

[SOLVED] AppwriteExeption: null , XMLHttpRequest error (0)

  • 0
  • Self Hosted
  • Flutter
  • Web
Lenolium
30 Mar, 2023, 13:05

Hi there, I host a flutter web app on firebase hosting. But I am getting the error: AppwriteExeption: null , XMLHttpRequest error (0) Does anybody have an idea why i get this and even better how I can solve it. Would help me out like a lot πŸ™‚

TL;DR
The user was experiencing an AppwriteException with the error message "XMLHttpRequest error (0)". They later realized that they had not set the endpoint correctly. The user also asked for guidance on how to add the endpoint in the .env file. It was suggested to check for any errors in the network tabs and ensure that firebase-hosting endpoint was added as a platform in the project platforms. The user also provided a code snippet that handled the exception and asked for any error message generated. The user shared that they did not get the error on their local machine and asked for further assistance in resolving the issue.
Binyamin
30 Mar, 2023, 13:06

In what context you getting the error? You don't get it in your local machine?

Binyamin
30 Mar, 2023, 13:07

Can you share the code + the error

Lenolium
30 Mar, 2023, 13:07

I don't get in in my local machine

Lenolium
30 Mar, 2023, 13:07

try { final account = await _account.get(); return account.$id; } on AppwriteException catch (error) { if (error.code == 401) { return null; } if (error.code == null || error.code == 0) { rethrow; } rethrow; }

Binyamin
30 Mar, 2023, 13:08

Add log here

TypeScript
try {
      final account = await _account.get();
      return account.$id;
    } on AppwriteException catch (error) {
      print(error.message);
      if (error.code == 401) {
        return null;
      }
      if (error.code == null || error.code == 0) {
        rethrow;
      }
      rethrow;
    }

And tell us what it says

Lenolium
30 Mar, 2023, 13:08

AppwriteExeption: null , XMLHttpRequest error (0)

Binyamin
30 Mar, 2023, 13:09

The error code is also null?

Lenolium
30 Mar, 2023, 13:09

yes

Binyamin
30 Mar, 2023, 13:10

And is the firebase-hosting endpoint was added as a platform in the project platforms?

Binyamin
30 Mar, 2023, 13:10

Also, Can you show the error in the networks tabs? Like so https://discord.com/channels/564160730845151244/1090661649574264863/1090663418211618826

Lenolium
30 Mar, 2023, 13:11

how do I need to add the endpoint in the .env file ?

Binyamin
30 Mar, 2023, 13:12

I meant here

Lenolium
30 Mar, 2023, 13:14

Uhhhf thx yeah

Lenolium
30 Mar, 2023, 13:14

i didn't set the endpoint right

Lenolium
30 Mar, 2023, 13:14

sorry for wasting your time

Binyamin
30 Mar, 2023, 13:14

And it's work now?

Lenolium
30 Mar, 2023, 13:14

yes

Binyamin
30 Mar, 2023, 13:14

Great You can mark as [Solved]

Lenolium
30 Mar, 2023, 13:16

AppwriteExeption: null , XMLHttpRequest error (0) [Solved]

Lenolium
30 Mar, 2023, 13:17

[SOLVED] AppwriteExeption: null , XMLHttpRequest error (0)

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