Has anyone received a compile error that makes you use , instead of ; in an axios call?axios preflight fail error 301 using vue.jsVue-axios interceptor 401 errorReact native axios calling action inside .then callback not workingis there any better way to handling axios error with laravel and vue jsGet a 401 error with POST and PUT Laravel passport/Vue/AxiosAxios: Not going into catch method with errorAxios POST returns “Network Error” even if status is 200 and there's a responseJS Axios - how to get response body in event of error?axios not failing on get call in NS VUEJS APPTypeError: Cannot read property 'status' of undefined when receiving errors from Laravel validation
Why weren't the Death Star plans transmitted electronically?
On the meaning of 'anyways' in "What Exactly Is a Quartz Crystal, Anyways?"
How can this Stack Exchange site have an animated favicon?
Quick Yajilin Puzzles: Scatter and Gather
Can an integer optimization problem be convex?
Why does C++ have 'Undefined Behaviour' and other languages like C# or Java don't?
Safe to use 220V electric clothes dryer when building has been bridged down to 110V?
Does "as soon as" imply simultaneity?
Worms crawling under skin
How do pilots align the HUD with their eyeballs?
Is it a good idea to leave minor world details to the reader's imagination?
Is differentiation as a map discontinuous?
Do wheelchair aircraft exist?
Proper way to shut down consumer
Clear text passwords in Unix
Should the average user with no special access rights be worried about SMS-based 2FA being theoretically interceptable?
Do we have any particular tonal center in mind when we are NOT listening music?
Tesla coil and Tesla tower
How to justify a team increase when the team is doing good?
Is it impolite to ask for halal food when traveling to and in Thailand?
Do we know the situation in Britain before Sealion (summer 1940)?
relating two diagrams in tikzcd
Aesthetic proofs that involve Field Theory / Galois Theory
Lost Update Understanding
Has anyone received a compile error that makes you use , instead of ; in an axios call?
axios preflight fail error 301 using vue.jsVue-axios interceptor 401 errorReact native axios calling action inside .then callback not workingis there any better way to handling axios error with laravel and vue jsGet a 401 error with POST and PUT Laravel passport/Vue/AxiosAxios: Not going into catch method with errorAxios POST returns “Network Error” even if status is 200 and there's a responseJS Axios - how to get response body in event of error?axios not failing on get call in NS VUEJS APPTypeError: Cannot read property 'status' of undefined when receiving errors from Laravel validation
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Compile error unless I use a comma in an axios call.
Here is the error. 'Unexpected token, expected ","'
in a vue I have an axios call.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data;
console.log(response.data);
))
.catch(error => console.log(error));
I get a compile error if I don't use commas.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data,
console.log(response.data)
))
.catch(error => console.log(error));
I also get a compile error if I try to run an if() statement in .then(). I'm using the latest versions of Laravel, Vue and Axios. Has amyone else had this issue? or have a fix?
laravel vue.js axios
add a comment
|
Compile error unless I use a comma in an axios call.
Here is the error. 'Unexpected token, expected ","'
in a vue I have an axios call.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data;
console.log(response.data);
))
.catch(error => console.log(error));
I get a compile error if I don't use commas.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data,
console.log(response.data)
))
.catch(error => console.log(error));
I also get a compile error if I try to run an if() statement in .then(). I'm using the latest versions of Laravel, Vue and Axios. Has amyone else had this issue? or have a fix?
laravel vue.js axios
That's because you're using()
instead ofin your then callback
– Derek Pollard
Mar 28 at 18:13
add a comment
|
Compile error unless I use a comma in an axios call.
Here is the error. 'Unexpected token, expected ","'
in a vue I have an axios call.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data;
console.log(response.data);
))
.catch(error => console.log(error));
I get a compile error if I don't use commas.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data,
console.log(response.data)
))
.catch(error => console.log(error));
I also get a compile error if I try to run an if() statement in .then(). I'm using the latest versions of Laravel, Vue and Axios. Has amyone else had this issue? or have a fix?
laravel vue.js axios
Compile error unless I use a comma in an axios call.
Here is the error. 'Unexpected token, expected ","'
in a vue I have an axios call.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data;
console.log(response.data);
))
.catch(error => console.log(error));
I get a compile error if I don't use commas.
axios
.get('/api/messages/'+this.issue)
.then(response => (
this.messages = response.data,
console.log(response.data)
))
.catch(error => console.log(error));
I also get a compile error if I try to run an if() statement in .then(). I'm using the latest versions of Laravel, Vue and Axios. Has amyone else had this issue? or have a fix?
laravel vue.js axios
laravel vue.js axios
asked Mar 28 at 17:38
mkrisch76mkrisch76
215 bronze badges
215 bronze badges
That's because you're using()
instead ofin your then callback
– Derek Pollard
Mar 28 at 18:13
add a comment
|
That's because you're using()
instead ofin your then callback
– Derek Pollard
Mar 28 at 18:13
That's because you're using
()
instead of
in your then callback– Derek Pollard
Mar 28 at 18:13
That's because you're using
()
instead of
in your then callback– Derek Pollard
Mar 28 at 18:13
add a comment
|
1 Answer
1
active
oldest
votes
The Issue
Your error is because javascript expects response => ()
to be a statement that is returned.
You can think of it like saying response => return (/* code */)
Solution
Instead, in order to use the arrow function without an immediate return, switch to brackets:
response =>
That way, javascript no longer expects a statement that returns right away, and will execute like a function with the full power of js.
Hope this helps!
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403807%2fhas-anyone-received-a-compile-error-that-makes-you-use-instead-of-in-an-axio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The Issue
Your error is because javascript expects response => ()
to be a statement that is returned.
You can think of it like saying response => return (/* code */)
Solution
Instead, in order to use the arrow function without an immediate return, switch to brackets:
response =>
That way, javascript no longer expects a statement that returns right away, and will execute like a function with the full power of js.
Hope this helps!
add a comment
|
The Issue
Your error is because javascript expects response => ()
to be a statement that is returned.
You can think of it like saying response => return (/* code */)
Solution
Instead, in order to use the arrow function without an immediate return, switch to brackets:
response =>
That way, javascript no longer expects a statement that returns right away, and will execute like a function with the full power of js.
Hope this helps!
add a comment
|
The Issue
Your error is because javascript expects response => ()
to be a statement that is returned.
You can think of it like saying response => return (/* code */)
Solution
Instead, in order to use the arrow function without an immediate return, switch to brackets:
response =>
That way, javascript no longer expects a statement that returns right away, and will execute like a function with the full power of js.
Hope this helps!
The Issue
Your error is because javascript expects response => ()
to be a statement that is returned.
You can think of it like saying response => return (/* code */)
Solution
Instead, in order to use the arrow function without an immediate return, switch to brackets:
response =>
That way, javascript no longer expects a statement that returns right away, and will execute like a function with the full power of js.
Hope this helps!
answered Mar 28 at 18:16
Derek PollardDerek Pollard
4,7776 gold badges27 silver badges41 bronze badges
4,7776 gold badges27 silver badges41 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403807%2fhas-anyone-received-a-compile-error-that-makes-you-use-instead-of-in-an-axio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
That's because you're using
()
instead ofin your then callback
– Derek Pollard
Mar 28 at 18:13