Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix Typescript export definitions #116
Conversation
Typescript does not support .mjs file, so the module that ends up being imported is the commonJS version (`dist/unfetch.js`). Since it does not contain a "default" export entry, using it in Typescript results in a runtime error: `TypeError: isomorphic_unfetch_1.default is not a function` Fix by reverting to `export =`. To use in Typescript, use the form `import * as fetch from "isomorphic-unfetch"`.
|
Yes, I have similar problem and this PR will solve it. Thanks @vincentcr |
|
I believe this should be addressed by #135, which drops the |
Typescript does not support .mjs files, so the module that ends up being imported is the commonJS version (
dist/unfetch.js). Since that file does not contain adefaultexport entry, using it in Typescript results in a runtime error:TypeError: isomorphic_unfetch_1.default is not a functionFix by reverting to
export =. To use in Typescript, use the formimport * as fetch from "isomorphic-unfetch".