I have a problem with eslint when building my docker containers, but for some reason when I want to create it it gives me an error in a global variable, which I use in the same component but it only shows an error in that one, this one refers to ‘API_PORT’ And I already tried to remove eslint for that line but it still gives me an error and I don’t understand, clearly I have that variable defined as it should be since before adding that section everything worked perfectly.
saveEditSession() {
// eslint-disable-next-line
axios.put(`http://${API_HOST}:${API_PORT}/view/sessions/${this.sessionToEdit}`, {
date: this.editDate,
time: this.editTime,
lastModifiedBy: sessionStorage.getItem('user'),
lastModifiedDate: new Date().toLocaleDateString('en-CA', { year: 'numeric', month: '2-digit', day: '2-digit' }),
})
.then(() => {
this.snackbarText = 'Session updated successfully';
this.snackbar = true;
this.fetchSessions(this.currentAppointmentIdToUpdate);
this.editSessionDialog = false;
})
.catch(error => {
error;
this.snackbarText = 'Error updating the session';
this.snackbar = true;
});
},
I have already checked the .env of both my front and the docker configuration and everything is correctly defined, the only way that does not give me an error and builds the containers is when I delete everything that is inside my function, but I need it, I import well and do everything correctly
#0 1.120 > vue-cli-service build #0 1.120 #0 2.510 All browser targets in the browserslist configuration have supported ES module. #0 2.510 Therefore we don't build two separate bundles for differential loading. #0 2.510 #0 2.565 #0 2.568 - Building for production... #0 66.18 ERROR Failed to compile with 1 error9:03:29 PM #0 66.18 #0 66.18 [eslint] #0 66.18 /app/src/views/ArticulosView.vue #0 66.18 842:34 error 'API_PORT' is not defined no-undef #0 66.18 #0 66.18 ✖ 1 problem (1 error, 0 warnings) #0 66.18 #0 66.18 #0 66.18 You may use special comments to disable some warnings. #0 66.18 Use // eslint-disable-next-line to ignore the next line. #0 66.18 Use /* eslint-disable */ to ignore all warnings in a file. #0 66.18 ERROR Error: Build failed with errors. #0 66.18 Error: Build failed with errors.
3