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

bug: Type 'MyContext' does not satisfy the constraint 'Context'. Types of property 'has' are incompatible. #263

Closed
adnanlah opened this issue Aug 13, 2022 · 6 comments · Fixed by #268

Comments

@adnanlah
Copy link

Hello!

I get the error Type 'MyContext' does not satisfy the constraint 'Context'. Types of property 'has' are incompatible. when I try to create a new Bot. The problem only happens with version 1.10 of Grammy and not with the 1.9.2 version.

type MyContext = HydrateFlavor<Context> & SessionFlavor<SessionData>
type MyApi = HydrateApiFlavor<Api>

export const bot = new Bot<MyContext, MyApi>(`${process.env.BOT_TOKEN}`)

photo_2022-08-13_12-38-37

Thanks.

@sartoshi-foot-dao
Copy link

Having the same issue. 1.9.2 works fine.

@rojvv rojvv closed this as completed Aug 23, 2022
@rojvv rojvv reopened this Aug 23, 2022
@rojvv
Copy link
Member

rojvv commented Aug 23, 2022

Misclick.

@rojvv
Copy link
Member

rojvv commented Aug 23, 2022

Anyways, is this Node.js or Deno?

@adnanlah
Copy link
Author

Anyways, is this Node.js or Deno?

Node.js.

@rojvv
Copy link
Member

rojvv commented Aug 23, 2022

Have you tried upgrading the dependencies?

@adnanlah
Copy link
Author

Have you tried upgrading the dependencies?

Yes I did.

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

Successfully merging a pull request may close this issue.

3 participants