-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable reach Vite dev server with start-server-and-test and axios #1817
Comments
axios defaults to accept only JSON and plain text. Set your accept header to include |
Is it a Vite specific setting not to accept I don't know if its a missing feature or a decision not to support it. |
I don't know where should it be in the codebase, but I would happily contribute it if it fits the repo. |
It's an explicit decision because |
Can confirm upgrading to later version fixes this. |
@dbousamra there was a fix in start-server-and-test but you still have to write |
Describe the bug
When I start my development server with Vite, it works completely fine in the browser, but querying it with
axios
like thisaxios.get('http://localhost:3000')
or with thestart-server-and-test
package it results in 404 responses.Here are the headers sent:
Reproduction
It's reproducible in my repository https://github.com/blacksonic/vue-3-playground by running
npm run test:e2e:javascript
or starting the dev server withnpm start
and runningnode ./axios.js
. Both cases return 404 errors.System Info
vite
version: 2.0.0-beta.56Logs (Optional if provided reproduction)
npm run test:e2e:javascript
.The text was updated successfully, but these errors were encountered: