You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code should have logged the data (html) from that url.
Mainly the issue is that default export is undefined.
Axios Version
>1.1.0
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
18.4.0
OS
Windows 10
Additional Library Versions
No response
Additional context/Screenshots
There were bugs like
1. In default export, that is undefined. [Image](https://media.discordapp.net/attachments/723104565708324915/1031017046743461928/unknown.png)
2. `Axios`'s instance's get functionhave a bug as well. [Image](https://media.discordapp.net/attachments/723104565708324915/1031017137382363336/unknown.png)
I tested old versions and for me version `1.1.0` and earlier versions are working fine.
Reacted by Olivier Liechti, Ramil Amerzyanov, Matt Drollette, Grant Eben, Rich Wood, Seoker Wang, squaresmile, Jorge Tomas and Hairy
There's something fundamentally broken on this main version :
import axios from './lib/axios.js';
_____^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
@Zighy I can't speak officially for axios, but a quick test seems to say that node v12 should do the trick, but v12 has passed end of life date as well.
@ralphtheninja I am using v18, but the default export is not working for me.
And for using the axios class itself, I did used it but its get function was throwing some issue.
So for now I am just using a old version.
I can just give some background on how we're using axios. It's part of a custom module that we use in-house that's being used by both node and the browser (react). The following seems to work well for both node and the browser:
Will be doing another release this week. Apologies for this not being very smooth, seems the upgrade to ESM was a lot rockier than previously expected.
Reacted by KrazyDev, Biplob Sutradhar, darcyrush, Jorge Tomas, Filip Kaić, Olivier Liechti, Kevin Kirsche, Dustin Do, ralphtheninja and osabros
Activity
chrisskalog commentedon Oct 16, 2022
Still problems with this in typescript. Using version 1.1.3
TypeError: Cannot read properties of undefined (reading 'get')
fiki574 commentedon Oct 17, 2022
I can't believe that this is an on-going problem for over a full week already.
Using v1.1.3, which is still broken, this doesn't work as well:
import axios from "axios";
TypeError: Cannot read properties of undefined (reading 'get')
jasonsaayman commentedon Oct 17, 2022
For this use
import { Axios } from 'axios';Zighy commentedon Oct 17, 2022
Node v10.24.0 => Axios version 1.1.3 or 1.1.0
With :
const axios = require('axios');or
const axios = require('axios').Axios;There's something fundamentally broken on this main version :
import axios from './lib/axios.js';
_____^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
ralphtheninja commentedon Oct 17, 2022
@Zighy You're using an old version of node.
Zighy commentedon Oct 17, 2022
What is the minimum supported version of Node ?
ralphtheninja commentedon Oct 17, 2022
@Zighy I can't speak officially for axios, but a quick test seems to say that node v12 should do the trick, but v12 has passed end of life date as well.
KartikeSingh commentedon Oct 17, 2022
@ralphtheninja I am using v18, but the default export is not working for me.
And for using the axios class itself, I did used it but its get function was throwing some issue.
So for now I am just using a old version.
ralphtheninja commentedon Oct 17, 2022
@KartikeSingh Have you tried the following with axios 1.1.3 (in node)?
ralphtheninja commentedon Oct 17, 2022
I can just give some background on how we're using
axios. It's part of a custom module that we use in-house that's being used by both node and the browser (react). The following seems to work well for both node and the browser:Hope this helps.
KartikeSingh commentedon Oct 17, 2022
hmm I see, seems like
defaultis broken for node, I will try usingconst axios = require('axios');Edit:
yes the above method words, So I think they need to fix their typings.
chrisskalog commentedon Oct 17, 2022
Yes it is a typings problem, would be nice if someone could fix it so that we can start using the latest version
jcurlier commentedon Oct 21, 2022
+1
jasonsaayman commentedon Oct 24, 2022
Will be doing another release this week. Apologies for this not being very smooth, seems the upgrade to ESM was a lot rockier than previously expected.