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

Demo usage code fails #4

Open
Alex-Muirhead opened this issue Jul 2, 2021 · 1 comment
Open

Demo usage code fails #4

Alex-Muirhead opened this issue Jul 2, 2021 · 1 comment

Comments

@Alex-Muirhead
Copy link

Running the demonstration usage code with no modifications gives the following errors:

error: TS2612 [ERROR]: Property 'resolve' will overwrite the base property in 'Deferred<undefined>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
    public readonly resolve!: () => void;
                    ~~~~~~~
    at https://deno.land/x/[email protected]/tools/Deferred.ts:57:21

TS2322 [ERROR]: Type '{ token: string | undefined; text: string; channel: string; } | { token: string | undefined; channel: string; }' is not assignable to type 'ChatPostMessageArguments'.
  Property 'text' is missing in type '{ token: string | undefined; channel: string; }' but required in type 'ChatPostMessageArguments'.
                const postMessageArguments: ChatPostMessageArguments = typeof message === "string"
                      ~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/src/App.ts:762:23

    'text' is declared here.
        text: string
        ~~~~
        at https://deno.land/x/[email protected]/src/methods.ts:948:5

Found 2 errors.

I'm using the following version of deno:

deno 1.11.4+ed16f43 (canary, x86_64-unknown-linux-gnu)
v8 9.1.269.35
typescript 4.3.2
@gatchan0807
Copy link

I also got the same error.
Version: Deno v1.16.4

So now I run it with --no-check only at runtime to go through the type check.
This has allowed me to use it without any problems.

In Deno v1.17.0 or later, I heard that you can use --no-check=remote to skip type checking of dependent libraries only.
So, I think it is possible to use this to check the type of the code you write, and deal with it on the user side.
denoland/deno#12766

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