grammY icon indicating copy to clipboard operation
grammY copied to clipboard

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

Open adnanlah opened this issue 3 years ago • 6 comments

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.

adnanlah avatar Aug 13 '22 19:08 adnanlah

Having the same issue. 1.9.2 works fine.

sartoshi-foot-dao avatar Aug 23 '22 15:08 sartoshi-foot-dao

Misclick.

rojvv avatar Aug 23 '22 16:08 rojvv

Anyways, is this Node.js or Deno?

rojvv avatar Aug 23 '22 16:08 rojvv

Anyways, is this Node.js or Deno?

Node.js.

adnanlah avatar Aug 23 '22 16:08 adnanlah

Have you tried upgrading the dependencies?

rojvv avatar Aug 23 '22 17:08 rojvv

Have you tried upgrading the dependencies?

Yes I did.

adnanlah avatar Aug 23 '22 18:08 adnanlah