Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Broken in typescript & node: TypeError: axios_cookiejar_support_1.default is not a function #120

Closed
Bnaya opened this issue Dec 7, 2017 · 2 comments

Comments

@Bnaya
Copy link

Bnaya commented Dec 7, 2017

typescript 2.6.2, axios-cookiejar-support v0.2.1, node lts/boron and node lts/carbon.
this ts code:

import axiosCookieJarSupport from "axios-cookiejar-support";
axiosCookieJarSupport(Axios);

Is transpiled to

const axios_cookiejar_support_1 = require("axios-cookiejar-support");
axios_cookiejar_support_1.default(axios_1.default);

which throws

axiosCookieJarSupport(Axios);
                     ^
TypeError: axios_cookiejar_support_1.default is not a function

See microsoft/TypeScript#5565

The solution would be to change the d.ts file and remove the default export.

@3846masa
Copy link
Owner

3846masa commented Dec 8, 2017

Sorry.
Because of babel-plugin-add-module-exports, default export converted to commonjs module.exports.
I decide to remove babel-plugin-add-module-exports, please wait to release new version (I'll rewrite now).

@3846masa
Copy link
Owner

3846masa commented Dec 8, 2017

@Bnaya I released as v0.3.0. Please try it.

Thanks for your report.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants