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

Requirement of allowSyntheticDefaultImports and esModuleInterop for Typescript usage should be documented #23

Open
karottenreibe opened this issue May 20, 2019 · 1 comment

Comments

@karottenreibe
Copy link

I got weird typing errors after adding react-lazy-images to my project and didn't understand them until I read #13. Using the workaround described there works for me. I think, however, it would make this project easier to use for anyone using TypeScript if this requirement were clearly documented in the project's README. Otherwise you have to have the insight to look into the closed GitHub issues here to find #13.

@fpapado
Copy link
Owner

fpapado commented May 27, 2019

Hi, @karottenreibe!

That sounds frustrating, I imagine getting odd errors like that can be a bad first experience.

The issue of Typescript versioning and their various config options has been gnawing at me for a while.
My assumption has been that Typescript will type-check libraries with their own settings.
That would mean that this codebase using the esModuleInterop would not affect the consumer type-checking.
That seems to not be the case here though, and I would like to figure out why.

Would you be able to share some things about your Typescript + Project set up?
I am particularly interested in:

  • Your Typescript version
  • The tsconfig.json (I know this might have specific things; compilerOptions and any reference to node_modules might be a smaller subset)
  • Were the errors in an IDE, the CLI or both? Sometimes I find those differ :/

Either way, I think this is a good note to add to the docs! If it's confusing for folks, and a note helps get them unblocked, I'm all for it :)

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