-
-
Notifications
You must be signed in to change notification settings - Fork 65
Typings wrong, leads to problem starting with Typescript version 4.8.3 and Node module resolution Node16 or NodeNext #2070
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
Comments
Hey @gunters63, I don't see any issues when using a fresh create-react-app project: Personally, I have never used Regards, |
Hi @hodgef , I tried to reproduce the error with a minimal create-react-app, like you. The error happens only when you use moduleResolution Node16 or NodeNext in tsconfig,json. You will have to change some imports for this of course, like: react-simple-keyboard is not the only npm package bitten by this. See again: microsoft/TypeScript#50690 I changed the issue title now accordingly. |
I can try to fix this problem and create a PR? |
Thanks for the details @gunters63. I will look into this, but if you have a repro to share or a PR fix that we can use it will definitely be welcomed. I will update this ticket as I delve into this. |
Here is the repo: https://github.com/gunters63/issue-2070, just use |
I don't really fully understand the implications of default exports/imports with Typescript 4.8.3 and NodeNext resolution yet (other than default exports seem to be frowned upon now :)). But an easy solution would probably be just to add this line:
to index.ts and in index.modern.ts. This enables me to import the module like this:
I couldn't get it to work with default exports/imports. |
The following workaround works for me (see end of first comment microsoft/TypeScript#50690 (comment)):
|
Hey @gunters63, sorry for the delay. I have pushed your proposed fix and it seems to work great: Feel free to give it a try on the latest version. Thanks! |
React-simple-keyboard version
3.4.199 or newer
Describe the bug
does not work anymore with Typescript 4.8.3 with error:
Maybe this only happens when you import react-simple-keyboard in a project where module: "EsNext" is set.
Explanation here: microsoft/TypeScript#50690
The text was updated successfully, but these errors were encountered: