Image for post
Image for post

TypeError: config.cancelToken.throwIfRequested is not a function

or first check your code, than try to find a solution using google.

First at all — I am not the only one. And second — how stupid not to investigate further why something does not work and google around for a solution.

I guess in 99 percent of all cases the problem is sitting right in front of your monitor — me myself and I.

So next time, you have a problem. First and second look into your code and do not google around.

Having a type, this should not happen — but I don’t like types in JavaScript.

The short story is. I use axios in my VueJS application to request my backend and also want to cancel request that has not been fullfilled but should be aborted. So I use the mysterios method CancelToken.

But this give you an object containing the token, not the token itself. So using it in a request should be done like this.

And what did I instead? My fault was to forget the .token, and that leads to what?

The title of the story. ;-)

Lesson learned for me.

That also shows why naming is so important in programming.

Image for post
Image for post


Written by

Developer since the 80'th, working at Forschungszentrum Jülich ( …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store