Closed gaghigogu closed 2 months ago
Hey @gaghigogu, usually <no response> fetch failed
means that no server is responding on this route. I assume your API is unreachable from your Node server.
I don't have an experience with Laravel Valet. How do you run your Nuxt app?
Hey @gaghigogu, usually
<no response> fetch failed
means that no server is responding on this route. I assume your API is unreachable from your Node server.I don't have an experience with Laravel Valet. How do you run your Nuxt app?
I run the Nuxt app using npm run dev
.
Laravel valet basically installs a dnsmasq instance redirecting all *.test domains to localhost. It then creates a nginx config for each managed site (ex. the api.domain.test config points the directory where the laravel app is installed).
Should I assume that the node server is not using dnsmasq rules then?
Thanks in advance for any help.
Ok, more findings: the problem is related to the fact that the node server does not read /etc/hosts or dnsmasq configs. Or at least mine acts this way. It uses the network dns, so I'm kinda done with this setup.
Serving laravel app with php artisan serve
and setting the api url in .env file of nuxt app to http://localhost:8000
does the trick.
Hope that this could be helpful for someone.
I'm glad you figured that out, thanks for leaving a comment with details @gaghigogu! I would say for local development it is always more straightforward to just use localhost
.
Hi,
I am experiencing the same problem described here #57. The difference is that I'm not using containers. The sanctum app is running behind Laravel Valet (nginx) at api.domain.test (https) while the nuxt app I'm trying to develop is served at app.domain.test.
Sorry if this question looks stupid but I cannot understand why it's not working.
Here are some details:
The login process is working as it should, redirecting me to a index page. If I try to make more requests from that page the auth keeps working:
I tried logging the request details on the Laravel app and everything is correct:
By the time I reload the browser page, no request is logged on the Laravel app, browser is redirected to login page and this message is logged:
Note that everything works with ssr off (as I first guessed from the error message above)
Any help is appreciated.