Skip to content
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

Cannot import using webpack on dev mode #430

Open
philip-peterson opened this issue Sep 19, 2020 · 3 comments
Open

Cannot import using webpack on dev mode #430

philip-peterson opened this issue Sep 19, 2020 · 3 comments

Comments

@philip-peterson
Copy link

philip-peterson commented Sep 19, 2020

Hi there,

I could not get this module to import using webpack in development mode (production might* work). The skeleton used is here: https://github.com/vikpe/react-webpack-typescript-starter

This might have to do with how microbundle works. I found this issue, maybe package.json needs the module field?

developit/microbundle#19

* = correction

@philip-peterson
Copy link
Author

Found a workaround -- even though it's a default export, library will work with this usage:

import * as useAbortableFetch from "use-abortable-fetch";

@mauricedb
Copy link
Owner

Hi @philip-peterson

I used to have module in there but I removed it because of incompatibility with CRA at the time. Quite possible it could come back and work now, I need to test that.

But given your workaround it sounds like you need allowSyntheticDefaultImports in your tsconfig.json as that is all about avoiding import * as xx syntax. See here.

@philip-peterson
Copy link
Author

@mauricedb Thanks, I did not know about synthetic imports. Much appreciated!

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

No branches or pull requests

2 participants