-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
TypeError: axios.get is not a function (v1.1.0) #5038
Comments
I am experiencing this breaking change, my production app is broken and unusable to my clients. |
Me three. Prod is down. Got woken up here by confused users |
Pinning |
I've tested and confirmed going to version 1.0.0 also works, problem is that will require app store review. IMO the devs should roll the distribution back. |
We are also experiencing this issue, and will have to wait for app store review for a fix unless the hosted code can be fixed. Adding to the vote for roll back to 1.0 |
It looks like version 1.0.0 had an issue affecting commonjs/umd exports ( |
It affected my app in production too, axios is not a function. |
@jasonsaayman Tagging for visibility. |
Confirmed as breaking production applications on my end as well. This is a big miss in testing coverage for a library like this. |
Also having multiple broken production apps here. |
same, my production environment has broken |
Major issues on our sites, had to change and pin to 0.27.0 |
Experiencing issues as well on production apps. |
same here! All apps using axios are broken! |
For anyone calling the non version specific unpkg CDN link you can switch to this version to fix the current problem |
At the time of this comment:
|
axios.post not working as well |
Axios a introduit une régression en livrant la version v1.1.0. Comme on chargeait toujours la version la plus récente, on s'est retrouvé avec une version qui ne marche pas. (cf. axios/axios#5038)
Axios a introduit une régression en livrant la version v1.1.0. Comme on chargeait toujours la version la plus récente, on s'est retrouvé avec une version qui ne marche pas. (cf. axios/axios#5038)
gotta git get imo |
I found out that the @jasonsaayman I think this is an incompatible breaking change that should be reverted or disclosed. FYI, If you are a NodeJS user, using commonJS and want to use original interface of axios, you should use const axios = require("axios").default; If you use ESM, there is nothing you should do since the interface doesn't change. If you uses axios@1.1.0 in browser, you , you should use axios.default.get("http://www.google.com/generate_204");
// or if you don't care `AxiosHeaders` which is only available in `axios` object (`axios.AxiosHeaders`),
// you can directly override it
const axios = axios.default;
axios.get("http://www.google.com/generate_204"); |
To be honest, this change addressed type definition issue indeed, I don't need this JSDoc comment at all:
So I would like to suggest that the change should be disclosed rather than reverted. |
An error "TypeError: axios.get is not a function" on the latest v1.1.0 was detected today. Oct. 7th, Working at v1.1.2 |
Can repro. This is causing major issues with an electron app of mine. Axios is used via unpkg versionless inside of the asar and there is no way to notify users to update as all requests to autoupdater are handled through axios... This should be reverted, and such a breaking change should have been communicated well in advance (and NOT distributed under a semver minor change!!) |
Thank you! |
+1 :( |
This just killed 3 of my client's applications with this problem. I downloaded the old 1.0.0 and used it locally on all applications until this is solved in 1.1.0. I recommend for everyone do the same. |
Thanks. Any idea how long these things take to reflect on CDNs generally? We're not pinned to a version. I've pinned back to 1.0.0 where possible but have some complex sites that rely on "latest version" from CDN. "https://unpkg.com/axios/dist/axios.min.js" |
It seems that the "axios.get is not a function" error is still on version 1.1.1 |
Still have "axios.get is not a function" error while using "https://unpkg.com/axios/dist/axios.min.js". |
Also getting 'Axios.post is not a function' when using "https://unpkg.com/axios/dist/axios.min.js". |
We are also having this issue with 'https://az416426.vo.msecnd.net/scripts/a/ai.0.js' |
@jasonsaayman In 1.1.1, the export is still in |
Why you guys don't point to a specific version is far beyond me. |
Yeah I see, it seems the browser bundle was also affected will fix |
I have to agree even though I am guilty of this. Learn't a lesson today. |
Working at v1.1.2 |
I have the same problem with axios: "Uncaught TypeError: axios.get is not a function" |
I think anyone who is having this problem should really get some consultancy about how to deploy applications to prod. I'm not trying to be condescending. I'm telling this because all your deployments are wide open to a supply-chain attack which is even worse than having your prod broken. |
Common, we fixed prod yesterday using axios.default, and now is broken again lol. Gotta use https://unpkg.com/axios@0.27.2/dist/axios.min.js until they decide if it is going to be axios.default or axios. |
This is a good point, but consider the README.md explicitly encourages this usage of the package. |
More specifically:
|
I sincerely hope every single one of those who were complaining about the 1000+ production websites this just broke have now each contributed hundreds of dollars to the maintainers of this package to recognize all the labour they have been so carelessly profiting off of so far. |
I'm having the same error 'axios.get is not a function'. All my requests are broken now. |
You should update your version to 1.1.2. Otherwise, you have to use axios.default.get |
1.1.2 gave me the same error, I had to go back to 1.1.0. |
Since the latest versions, there are two groups of users with different ways importing axios
IMO, it would be ideal if we can find a way to support both styles, if not, we have to choose one and declare the other one invalid (which I think is |
Following... |
Can we lock this issue to avoid spam? They ran into this issue (in production) because they didn't pinned their dependencies correctly. |
Good god y'all, pin your dependencies. If your app can't handle an outage then make sure your versions are locked. |
Thanks for all the feedback everyone, also some great pointers here on how to manage your own software. On the way Axios should work when using it with Common JS it should always be: const axios = require('axios') I will work to make sure this is always the case. I will also update all the docs etc ASAP. Lastly, I will fix the problems that seem to now exist when using Type Script. I know this was a rough release, but I will endeavour to make them more smooth from here on. |
Missing test case is the RCA for this issue, its best to add another test case such that this issue doesn't happen again in the future |
What you can learn from this issue:
|
it works on my machine |
Describe the bug
The new version of axios (v1.1.0) is throwing an error for
axios.get
:TypeError: axios.get is not a function
.Note: This issue was not present in v1.0.0
To Reproduce
Include axio v1.1.0 via a
<script>
tag, and then reference it directly viaaxios.get()
Expected behavior
axios.get
should be a valid function.Environment
The text was updated successfully, but these errors were encountered: