-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
error TS2307: Cannot find module 'whatsapp-api-js/messages' #113
Comments
Hi! Which is your whatsapp-api-js version? Keep in mind the modular import syntax is for the 1.0.0 version |
i try with 1.0.0-beta.5 |
Great, let me know if it works so I can mark the issue as complete |
Same problem here. 1.0.0-beta.5 / commonjs |
I managed to replicate the issue, I'm 100% sure it's a configuration issue with the exports at package.json. I'm reading the documentation to understand how's the "types" property meant to be used. Tomorrow I have a 2 and a half hour flight, so I might be able to find a solution on the go. No workaround other than @ts-ignore the issue unfortunately, as it's only a types problem :/ |
I finally came across the GitHub issue at TS saying why this specific error isn't "supported": Unfortunately, this unsupported feature was how I supposed exports were meant to be used with TypeScript. Under the hood possible fixes:
Unfortunately, until I settle down which solution to use, the only fix is ts-ignore Thanks for opening and commenting on the issue! Further reading: https://github.com/andrewbranch/example-subpath-exports-ts-compat |
@arivanbastos no, i still have the problem |
Hi! I finally fixed the issue with minimal changes to the package.json, so there are no breaking changes. Check out the PR, I won't be able to publish a new release from my phone in at least a few hours, but it's easy to update locally:
Let me know if this fixes the issue for both of you, and I will merge the PR Thanks for the issue! |
@Secreto31126 thnk you for reply. @50c10
I had to import GetParams type also, cause I got typescript type errors when using the whatsappAPI.get() method (for webhook validation proccess).
|
@arivanbastos. I tried the solution and it worked fine. |
Thanks for the confirmation! I will be merging the branch in a few hours and pushing a release to npm. |
when i try to import whatsapp-api-js/messages i get the error message. this only happens wen import some message
The text was updated successfully, but these errors were encountered: