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
fix problem with named export axios
and Typescript NodeNext
#5288
Conversation
Please re-check this should be solved, if not @ me and I will have a look again |
@jasonsaayman I just updated my repro akphi/issue-repo#12 to use
|
Yes, Axios exports its factory only as a default export, and all other exported properties defined in the factory are also available as named export. It seems like this behavior has a logical fit with the existing commonjs interface. Basically, it's not a big deal to re-export the factory as a named export too, but historically Axios had only default export, so all the tutorials are written for default export. I may be wrong, but having |
@DigitalBrainJS is there anything else you want me to do on this PR? |
will close this for now |
Instructions
Fixes #5101
I also chucked in a small fix for the default export to work with
NodeNext
, a bit of context heremicrosoft/TypeScript#49298
microsoft/TypeScript#50690
Basically, I will make it so people can import
axios
as a named import rather than having to do something like:UPDATE: I saw you have already taken care of #5101 by updating
exports
inpackage.json
, but the problem with named exports remains. Please see my repro here akphi/issue-repo#12I don't think
import { axios } from 'axios';
work at all in my case and I'm pretty sure this should help fixes #5101