Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Typescript export definitions#116

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
vincentcr wants to merge2 commits intodevelopit:main
base:main
Choose a base branch
Loading
fromvincentcr:fix-typescript-export

Conversation

vincentcr
Copy link

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 adefault export entry, using it in Typescript results in a runtime error:TypeError: isomorphic_unfetch_1.default is not a function

Fix by reverting toexport =. To use in Typescript, use the formimport * as fetch from "isomorphic-unfetch".

Typescript does not support .mjs file, so the module that ends up beingimported is the commonJS version (`dist/unfetch.js`). Since it does not contain a"default" export entry, using it in Typescript results in a runtimeerror: `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"`.
@shevchenkonik
Copy link

Yes, I have similar problem and this PR will solve it.

Thanks@vincentcr

@developit
Copy link
Owner

I believe this should be addressed by#135, which drops the.mjs file extension and moves back tounfetch.module.js. Can anyone confirm?

@developitdevelopit added the needs-more-infoinformation is needed to move forward labelFeb 18, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
needs-more-infoinformation is needed to move forwardtypescript
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@vincentcr@shevchenkonik@developit

[8]ページ先頭

©2009-2025 Movatter.jp