Failed to load resource: A server with the specified hostname could not be
I deployed my app and am able to navigate to the webpage: https://my-wasp-app-client-damp-snowflake-7739.fly.dev
However, I get this error repeatedly in the console. Have googled extensively. I cant sign in or do any of the app functionalities behind the auth.
21 Replies
Hi @Trigaten. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided, it seems like your client is not able to communicate with the server. This could be due to a variety of reasons such as incorrect environment variables, CORS errors, or issues with the server deployment.
Here are a few steps you can take to troubleshoot this issue:
1. Check your environment variables: Ensure that you have correctly set the
WASP_WEB_CLIENT_URL
environment variable on your server. This should be the URL of your deployed client. You can set this variable by running flyctl secrets set WASP_WEB_CLIENT_URL=<url_of_deployed_client>
(source (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-flyio-app)).
2. Check for CORS errors: If your server is configured to only accept requests from a specific origin, it might reject requests from your client if the origins don't match. You can check for CORS errors in your browser's console (source (https://discord.com/channels/686873244791210014/1201898985300971540)).
3. Check your server logs: You can view your server logs by running flyctl logs
(source (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-flyio-app)). This might give you more information about what's going wrong.
4. Redeploy your app: Sometimes, redeploying your app can solve the issue. You can do this by running wasp deploy fly deploy
(source (https://discord.com/channels/686873244791210014/1201898985300971540)).
5. Upgrade your Wasp version: If you're using an older version of Wasp, upgrading to the latest version might solve the issue. You can do this by running curl -sSL <https://get.wasp-lang.dev/installer.sh> | sh
and updating the Wasp version in your main.wasp
file (source (https://discord.com/channels/686873244791210014/1201898985300971540)).
If none of these steps solve your issue, please provide more information about your setup and the exact error message you're seeing.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Trigaten, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?check fly.io for error logs
specifically server errors
I have been looking at them, one sec
Look pretty good to me, will look at client
STRIPE_API_KEY not found, but that shouldnt kill build
I also see
XMLHttpRequest cannot load https://my-wasp-app-damp-snowflake-7739-server.fly.dev/auth/me due to access control checks.
in my web terminal nowClient is maybe having issues, but looks fine
I wonder if its related to leaving my app as default name
my-wasp-app
š
Wohooo @Trigaten, you just became a Waspeteer level 1!
Im gonna try rerunning everything with a unique name
Wasp CLI doesn't handle the case where the Fly app name is taken (obv somebody used
my-wasp-app
) and because of that it doesn't set the env vars properly - as we already talked on Github š
I'd advise you to:
1. Delete the TOML files from your app dir
2. Delete the Fly apps
3. Rerun the process šty!
Good luck, report back how it goes š
Ah that was you, ty again
will do
Interesting, so reran, and don't get that error anymore, but when I go to one of the pages (https://pub-adjust-client.fly.dev/audio-upload), I get this:
Notably, while building I saw this in terminal:
I may need to reset a bunch of keys, one sec
Failed to load resource: the server responded with a status of 401 () https://pub-adjust-server.fly.dev/auth/me
Seeing this in web terminal
In server logs, I see this on page load:
GET /auth/me 401 4.297 ms - 43
then this when i try to login:
Everything works locally, im basically just copying yalls free saas example. Will keep investigating.@miho any ideas here?
This seems like a potential problem with wasp/the template. Signing off for today. Thanks for your help @miho .
Did you run
wasp db migrate-dev
and created the migrations? Without this things can't work š
That's what the errors are saying "there is no AuthIdentity in the database" which is an Wasp model for auth.
I'd advise going through Wasp's tutorial just to get the hang of things so you can speed up your learning process š https://wasp-lang.dev/docs/tutorial/create1. Creating a New Project | Wasp
You'll need to have the latest version of Wasp installed locally to follow this tutorial. If you haven't installed it yet, check out the QuickStart guide!
I did not. I went thru those docs somewhat before, but not sure if I would have known to migrate (limited webdev experience).
tysm, ill go through them fully now
Wohooo @Trigaten, you just became a Waspeteer level 2!
It looks like this problem is fixed. Im having a diff problem with mailgun, looking into that. Ill update here when done.
@miho letting you know that I (mostly you š ) have now solved this. Here is where I went wrong:
- used the default app name on deploy
- didn't know the perform migrate
The first was very avoidable. For the second, I didn't see it noted on the deploy page, and even having done the tutorial might not have known to do it.
It might be worth clarifying these further in the docs to help unexperienced devs like myself. I am happy to make a PR if you are interested š
Thank you for the feedback! š This helps us a lot to know which pieces of the docs could be improved.
The first was very avoidable.Ideally, we'd tell you - "hey, the app name is taken" - but this is something waiting to be implemented, sooner than later.
I am happy to make a PR if you are interestedPlease do - either make a PR with exact changes you think would be useful - or if it's too much, just add more info here and we'll update the docs based on your feedback.