All Questions
220 questions
147
votes
21
answers
121k
views
"Cannot use import statement outside a module" with Axios
I have a Vue.js application where two files contain:
import axios from "axios"
These files are located in src/lib within the application and include the import statement on their first line.
...
24
votes
2
answers
65k
views
Vue js 2 & Axios Post Request - Form
I am trying to post my form using axios, but I am not able to get the data to my backend using expressjs
This is what I am doing:
<template>
<form class="" method="post" @submit.prevent="...
14
votes
1
answer
17k
views
How to address backend host with axios, when frontend and backend are in virtual docker network
I'm building a simple Website with login, and my vue-frontend needs to retrieve user data from my nodejs-backend which connects to a sql database.
I decided to use docker-compose for this, and as I ...
14
votes
2
answers
18k
views
CORS: Why do I get successful preflight OPTIONS, but still get CORS error with post? [closed]
I have a Vue front end using axios to make http requests, and a Node back end using express. They are on different domains (when running locally, BE port is 3080 and FE port is 3000), and I am using ...
9
votes
3
answers
40k
views
how to submit "multipart/form-data" from VueJs
I am using VueJs / axios in frontend and multer in nodejs for a simple file upload to work.
So far all tries has been unsuccessful.
While this can be achieved in 100 ways in angular 1/2 using ng-...
8
votes
0
answers
3k
views
Nuxt.js - Axios crashes with 'Maximum call stack size exceeded'
I'm building a website using Nuxt Frontend + Node Backend.
Currently, I've implemented nuxtServerInit code inside Vuex store file.
The web seems working without error, but it often crashes with the ...
7
votes
2
answers
10k
views
Can I use Nuxt.js to render data from database?
I am in the process of learning nuxt.js, so I've decided to create a small project with it. I read couple of documentation. There's something that I did not fully understand though.
If Nuxt can use ...
6
votes
4
answers
30k
views
Why Chrome can’t set cookie
I have a response from my server. Response Headers contains a valid Set-Cookie. Chrome Response/Cookies says that I have 1 cookie, ok. But... The cookie is not setting into DevTools/Application/...
6
votes
5
answers
27k
views
Axios not passing headers on requests
I'm building a VueJS application and I'm using JSON web tokens as my auth system. When I log the user, I store the token with localStorage and works fine. I check the headers and it's in the '...
6
votes
2
answers
3k
views
Vue-cli with node
I'm a little bit confused about using Vue and node simultaneously. You can run a Vue-cli application locally by typing npm run dev and it runs on one port, and then I also created an express server ...
6
votes
2
answers
5k
views
POST Request to expressjs not working despite using CORS
I've got this function in my component, that's supposed to send a POST request to an express API:
onSubmit (evt) {
evt.preventDefault();
//alert(JSON.stringify(this.description));
...
6
votes
1
answer
9k
views
how get response in axios when api is steam like SSE (Server-Send Events)
Environment: web browser, javascript.
I want to use post method to call sse api (Server-Send Events) like
https://platform.openai.com/docs/api-reference/completions/create
curl https://api.openai.com/...
5
votes
1
answer
9k
views
Axios - How to fix - POST URL net::ERR_CONNECTION_RESET
How to fix this error message?
[xhr.js?b50d:178 POST http://localhost:3000/editor/add net::ERR_CONNECTION_RESET][1]
It works and append data, but I get this error message...
My API looks like this:
...
4
votes
4
answers
5k
views
req.query undefined in Nuxt Express Middleware get request
Not a pro with things like server middleware, but stuck without much clues.
In a vue component I am retrieving data with axios with this:
axios
.get('/api/getDailyFeedback', {
params: {...
4
votes
1
answer
16k
views
Vuejs: Axios post JSON data and Image data
Currently, I am creating a form with image data and JSON data. I am using 2 post method to post image data and JSON data separately to my nodejs backend. Is it any possible solution that enables me to ...