Closed Seyid-cmd closed 1 year ago
What version of node.js are you using? Make sure you are using the LTS version, not the latest one.
changing package.json to run "dev": nuxt dev --host 127.0.0.1
seems to be a janky fix temporarily.
OK yeah, that seems to help.
Run nuxt with nuxt dev --host 127.0.0.1
, make sure the env vars are all set to use 127.0.0.1
instead of localhost
// nuxt.config.js
runtimeConfig: {
public: {
backendUrl: 'http://127.0.0.1:8000',
frontendUrl: 'http://127.0.0.1:3000',
},
},
And on the Laravel app too so the CORS works
// .env
APP_URL=http://127.0.0.1:8000
FRONTEND_URL=http://127.0.0.1:3000
I can confirm. I just downgrade my node version to 16 through nvm, then changed localhost to 127.0.0.1. It works fine.
I also encountered this problem.
Two solutions have been found, either one is taken on a case-by-case basis:
ssr: false
to nuxt.config.ts
.
orplugins/auth.ts
to → plugins/auth.client.ts
Related links:
This seems to be fixed in Node.js As per this comment, if you are facing this problem try updating your Node.js version.
I have followed the instruction in the read me, but end up getting the error 500 "fetch failed ()". @at async Module.$larafetch (my-project-path-/utils/$larafetch.ts:33:12)