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

Project doesn't compile on Deno 1.20.3 #172

Closed
darvesh opened this issue Mar 26, 2022 · 5 comments · Fixed by #173
Closed

Project doesn't compile on Deno 1.20.3 #172

darvesh opened this issue Mar 26, 2022 · 5 comments · Fixed by #173

Comments

@darvesh
Copy link
Contributor

darvesh commented Mar 26, 2022

How to reproduce:

deno upgrade
deno cache "https://deno.land/x/grammy@v1.7.0/mod.ts"

Version:

deno --version                                                                                                                                    
deno 1.20.3 (release, x86_64-unknown-linux-gnu)
v8 10.0.139.6
typescript 4.6.2

Logs:

Check https://deno.land/x/grammy@v1.7.0/mod.ts
error: TS2769 [ERROR]: No overload matches this call.
  Overload 1 of 2, '(input: string | Request, init?: RequestInit | undefined): Promise<Response>', gave the following error.
    Argument of type 'string | URL' is not assignable to parameter of type 'string | Request'.
      Type 'URL' is not assignable to type 'string | Request'.  Overload 2 of 2, '(input: URL, init?: RequestInit | undefined): Promise<Response>', gave the following error.
    Argument of type 'string | URL' is not assignable to parameter of type 'URL'.
      Type 'string' is not assignable to type 'URL'.
    const { body } = await fetch(url);
                                 ~~~
    at https://deno.land/x/grammy@v1.7.0/platform.deno.ts:134:34



TS2322 [ERROR]: Type '((root: string, token: string, method: string) => URL) | ((root: string, token: string, method: string) => string)' is not assignable to type '(root: string, token: string, method: string) => URL'.
  Type '(root: string, token: string, method: string) => string' is not assignable to type '(root: string, token: string, method: string) => URL'.
    Type 'string' is not assignable to type 'URL'.
            buildUrl: options.buildUrl ??
            ~~~~~~~~
    at https://deno.land/x/grammy@v1.7.0/core/client.ts:207:13

    The expected type comes from property 'buildUrl' which is declared here on type 'Required<ApiClientOptions>'
        buildUrl?: (
        ~~~~~~~~
        at https://deno.land/x/grammy@v1.7.0/core/client.ts:131:5

Found 2 errors.
@darvesh darvesh changed the title Latest TypeScript breaks types Project doesn't compile on Deno 1.20.3 Mar 26, 2022
@ivcosla
Copy link

ivcosla commented Mar 26, 2022

Same issue

@KnorpelSenf
Copy link
Member

It works on 1.20.2 as stated in https://t.me/grammyjs/41202

@darvesh
Copy link
Contributor Author

darvesh commented Mar 27, 2022

@KnorpelSenf we can close this issue now?

@KnorpelSenf
Copy link
Member

Yes!

@KnorpelSenf
Copy link
Member

It seems like Deno will fix this on their side soon: denoland/deno#14113 (comment)

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