druxt / druxt.js

The Fully Decoupled Drupal Framework
MIT License
113 stars 21 forks source link

Local development - Request failed with status code 400 #379

Closed daan-ef2 closed 2 years ago

daan-ef2 commented 2 years ago

Hi all,

I'm just getting started with druxt, while I've been developing a lot of time with Gatsby and Wordpress, i am keen to learning this. But at the moment i am stuck while building my first druxtjs site.

Describe the bug When running "npm run dev" it quits with the following message: "FATAL Request failed with status code 400".

My drupal site is hosted locally and the jsonapi endpoint is working in the browser. I also set the correct link as baseUrl in the nuxt.config.js: http://backend.test

But still no dice, I also tested it with one of the examples and when changing the baseUrl to a local development url, it gives me the same message. When using https://demo-api.druxtjs.org it works.

Does anyone encountered the same problem?

Decipher commented 2 years ago

Hi @daan-ef2,

Can you provide your nuxt.config.js file, or the Druxt settings from the file?

What are you using to run your Drupal site? DDev, Lando, docker-compose, etc.

If it the frontend connects to the hosted backend, and the JSON:API is accessible in a browser, it's likely the communication between the frontend and backend.

If you are using docker containers, ensure they can access each other.