spxpertOriginal post
Web Developer
I have a very typical issue "it works on my machine" .I am building an app using Auth, Database and Storage modules. The authentication works perfectly in my local machine, however I published this using Appwrite site and auth fails (login / sign-up) with error saying
"Unexpected token '<', "<!doctype "... is not valid JSON"
What am I doing wrong?
https://petsagram.appwrite.network/
Summary
The user is experiencing an issue where authentication works locally but fails after publishing on Appwrite, resulting in an error related to invalid JSON ("Unexpected token '<', '<!doctype ..."). This typically indicates that the application is receiving an HTML response instead of the expected JSON, often due to a misconfigured environment or incorrect endpoint being hit.
To resolve this, ensure that the API endpoint for authentication is correctly set up in the published environment. Check for configuration issues in the Appwrite settings, and confirm that the URLs used for making API requests point to the correct production server rather than the local setup. Additionally, inspect the network requests in the browser’s