-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Types not working correctly unless module: "presserve" #376
Comments
Hi, I just went through the TS documentation to check what module preserve does, and I'm not quite sure if this is the exact reason why the code breaks. First of all, the On the other hand, I have an app for black box testing the messages (Secreto31126/whatsapp-api-test), and as you can see, the tsconfig.json file of the project doesn't use preserve (defaults to es6 if not defined, almost identical to NodeNext). I will definitely go through this issue later today. As you said, the library types should just work, so this is kinda annoying. Thanks for raising this issue! |
PS: I didn't understand what you meant in the Expected Behaviour, is that your tsconfig file or are you recommending using those settings for the library? |
That's the tsconfig I'm using in my project. About the types I was searching for this article that talks about potential issues when dual publishing and how to solve them, and specially that it has a tool that shows which issues a package has I link both in case you find them useful. |
Hey, so sorry I took so long to finally get back. I think 4.1.1 will fix this issue. It wasn't related to the module type, but rather the path resolution in TS and ESM Node, which enforces including a .js at the end of all the imports (even though the code is on TS 🙄) I will try to implement more testing to prevent such dumb mistakes, as it's clear v4 was a catastrophic release due to the lack of code quality I usually try to give. I will also check out tsup, which is the tool mentioned on the article you sent. Please, let me know if this solves the issue so I can safely close it, and once again so sorry to have left you on hold for almost a month. |
Describe the bug
Typescript doesn't resolve types correctly unless my tsconfig uses
module: Presserve
To Reproduce
Steps to reproduce the behavior:
The type of
args.message.type
isany
.Preserve
the type is correctly resolved:text | audio | ...
Expected behavior
Types should just work, the current tsconfig follows this recommendations
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: