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

Typescript definitions wrong with 21.2.6 #1590

Closed
Delagen opened this issue Apr 26, 2024 · 9 comments
Closed

Typescript definitions wrong with 21.2.6 #1590

Delagen opened this issue Apr 26, 2024 · 9 comments

Comments

@Delagen
Copy link

Delagen commented Apr 26, 2024

Steps to reproduce

  1. Compile TS with libCheck

Expected behaviour

Success

Actual behaviour

Error: node_modules/intl-tel-input/build/js/intlTelInput.d.ts:545:37 - error TS2307: Cannot find module 'i18n/en/countries.mjs' or its corresponding type declarations.
545 import countryTranslations from "i18n/en/countries.mjs";
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/intl-tel-input/build/js/intlTelInput.d.ts:546:39 - error TS2307: Cannot find module 'i18n/en/interface.mjs' or its corresponding type declarations.
546 import interfaceTranslations from "i18n/en/interface.mjs";
~~~~~~~~~~~~~~~~~~~~~~~

Initialisation options

@jackocnr
Copy link
Owner

Thanks for reporting this. Can you confirm that it works fine in the previous version: v21.2.5?

@Delagen
Copy link
Author

Delagen commented Apr 27, 2024

@jackocnr Yes. I temporary reverted to this version.

@jackocnr
Copy link
Owner

Thanks. @anthony0030 this error must be a result of the translation export changes we made - is there any chance you could take a look at this?

@jackocnr
Copy link
Owner

Looking at the difference between the types file in v21.2.5 vs v21.2.6 I think the problem is just that the 2 new imported modules have ".mjs" on the end, as the importing works fine a few lines later: import { Country } from "intl-tel-input/data";. So I wonder if we can just remove those extensions from the 2 imports in src/js/i18n/en/index.mjs (tho this may only work if we make all of these translation files have .ts extensions in src/ which would then require adding a build step to get .mjs files in build/ but hopefully this won't be necessary)

@anthony0030
Copy link
Contributor

Hi @jackocnr, I don’t have any experience really with TS. I would love to help but don’t know how.

@jackocnr
Copy link
Owner

No worries, I'll take a look when I find some time.

@MarcoGlauser
Copy link

Just another datapoint. Our CI build broke when trying to update to the newest version this morning. Fixing the library to 21.2.5 resolved the issue in the short tem.
Thank you for supporting this package for such a long time!

@jackocnr
Copy link
Owner

jackocnr commented May 1, 2024

@Delagen I've implemented the fix I mentioned here, and released it as v21.2.8 - can you give that a try and see if that fixes your issue?

@Delagen
Copy link
Author

Delagen commented May 1, 2024

@Delagen I've implemented the fix I mentioned here, and released it as v21.2.8 - can you give that a try and see if that fixes your issue?

Seems it works now. Thanks.

@jackocnr jackocnr closed this as completed May 1, 2024
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

4 participants