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 error TS2307 Cannot find module 'grammy/out/composer.js' #49

Open
zivni opened this issue Aug 19, 2024 · 3 comments
Open

typescript error TS2307 Cannot find module 'grammy/out/composer.js' #49

zivni opened this issue Aug 19, 2024 · 3 comments

Comments

@zivni
Copy link

zivni commented Aug 19, 2024

I'm getting the following error:

**node_modules/@grammyjs/menu/out/menu.d.ts:601:26 - error TS2307: Cannot find module 'grammy/out/composer.js' or its corresponding type declarations.

601     middleware(): import("grammy/out/composer.js").MiddlewareFn<C>;
                             ~~~~~~~~~~~~~~~~~~~~~~~~**

The fix seems to be adding type MiddlewareFn to the import from "./deps.node.js", and removing the import frim line 601

@grammyjs/conversations it works OK.

@KnorpelSenf
Copy link
Member

You should not modify the content in node_modules. Which versions of the plugin and the core lib are installed? Can you npm ls them?

Also, consider enabling skipLibCheck in your TS config.

@zivni
Copy link
Author

zivni commented Aug 20, 2024

I know I shouldn't just was checking to see what's wrong.

I'm using yarn and installed the latest of both:

grammy 1.29.0
@grammyjs/conversations 1.2.0
@grammyjs/menu 1.2.2
@grammyjs/types 3.13.0

@KnorpelSenf
Copy link
Member

Interesting, I'll try to reproduce this in a few days and see if it can be fixed by changing anything in the plugin. Until then, you can use skipLibCheck.

Naturally, if you feel like fixing it yourself in the code, please go ahead and open a pull request.

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