TypeError: axios.get is not a function (v1.1.0) · Issue #5038 · axios/axios · Gi...
source link: https://github.com/axios/axios/issues/5038
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Comments
addisonhardy commented 2 days ago •
Describe the bugThe new version of axios (v1.1.0) is throwing an error for Note: This issue was not present in v1.0.0 To ReproduceInclude axio v1.1.0 via a
Expected behavior
Environment
|
pablo-the-dev commented 2 days ago •
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 |
Author
addisonhardy commented yesterday
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 |
Author
addisonhardy commented yesterday
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. |
Author
addisonhardy commented yesterday
@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 |
My production has broken as well. |
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 |
Author
addisonhardy commented yesterday
axios.post not working as well |
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
If you use ESM, there is nothing you should do since the interface doesn't change. If you uses [email protected] in browser, you , you should use
|
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!!) |
Member
jasonsaayman commented 23 hours ago
Update to v1.1.1 this should slove the issue |
I'm going to try it! |
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". |
anasau commented 22 hours ago
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. |
Member
jasonsaayman commented 22 hours ago
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/[email protected]/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... |
Sponsor
Contributor
arthurfiorette commented 10 hours ago
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. |
Member
jasonsaayman commented 1 hour ago
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:
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 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK