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
Using http from to 1.6.7 (migrate from 0.27.2) #6208
Comments
Hello! I have not been able to reproduce your problem. Reproducing your environment made sure that everything works as expected. It seems that in your situation the problem is not with axios library, but with import. Did you specify the following line in pacakge.json: |
Hi, In package.json in package.json, is works as below and
finally,
I think this confusing caused by mixing I searched and considering to re-write all code as ESM, which may be better solution for this. Thanks again for advice @msugenius |
Hi! Thanks for the additional code snippets, now I realize that my conclusion was hasty. Those module are really incompatible since of
I hope my answer was useful. |
Describe the issue
This might be a bit of a strange question (and it's also because my understanding of Javascript is a bit limited).
I'm updating an existing legacy project and want to update the version of
axios
.I'm using the code I wrote below, and the version of the legacy is 0.27.2.
I want to update axios to 1.6.7 (latest),
so I changed code
import http from 'axios'
toimport axios from 'axios'
(as described in the README).When I try to update it, I get an error like below.
I checked some other issues, but I still couldn't solve the problem.
#5088, #5091, #5613, #5765, #5162
I'm using
0.27.2
because I don't have any major issues without updating, but I'm confused that I'm getting an error even though I'm usingimport
instead ofrequire
.Do you have any suggestions on how to resolve this?
Thanks.
Example Code
Expected behavior
No response
Axios Version
0.27.2
Adapter Version
No response
Browser
Chrome
Browser Version
120.0.6099.234
Node.js Version
18.18.0
OS
macOS (m1)
Additional Library Versions
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: