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

Property 'rest' does not exist on type 'OctokitWithDefaults' #2129

Open
4 of 7 tasks
dalanmiller opened this issue Jul 10, 2021 · 3 comments
Open
4 of 7 tasks

Property 'rest' does not exist on type 'OctokitWithDefaults' #2129

dalanmiller opened this issue Jul 10, 2021 · 3 comments
Labels
deno Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects

Comments

@dalanmiller
Copy link

Please avoid duplicates

Reproducible test case

https://gist.github.com/dalanmiller/0344b590d83f83f271fb080d9c7be97b

Please select the environment(s) that are relevant to your bug report

  • TypeScript
  • Enterprise
  • Browsers
  • Node
  • Deno

Version

Latest per:

import {Octokit} from 'https://cdn.skypack.dev/@octokit/rest';

What happened?

Get a static check error saying that .rest property doesn't exist on Octokit instantiation.

When attempting to run, I get confirmation:

Check file:///Users/dalanmiller/repos/flat/postprocess.ts
error: TS2339 [ERROR]: Property 'rest' does not exist on type 'OctokitWithDefaults'.
            await octokit.rest.issues.create({
                          ~~~~
    at file:///Users/dalanmiller/repos/flat/postprocess.ts:337:27

Would you be interested in contributing a fix?

  • yes
@dalanmiller dalanmiller added the Type: Bug Something isn't working as documented label Jul 10, 2021
@ghost ghost added this to Bugs in JS Jul 10, 2021
@wolfy1339 wolfy1339 added the typescript Relevant to TypeScript users only label Jul 10, 2021
@wolfy1339
Copy link
Member

Can you share your tsconfig?

The code looks fine to me

@wolfy1339 wolfy1339 added the deno label Jul 10, 2021
@dalanmiller
Copy link
Author

dalanmiller commented Jul 10, 2021

No .tsconfig just:

❯ cat .vscode/settings.json                                                  
{
  "deno.enable": true
}%

And agreed, I read through all the octokit.js docs, but then it's also failing at runtime.

@gr2m
Copy link
Contributor

gr2m commented Jul 13, 2021

This is most likely related to the Deno compatibility problems we discussed in the other issues and the discussion at #1708.

I'm open to simple fixes that resolve the compatibility problems. I think the proper fix will be #2128, I won't look into Deno compatibility before that myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects
No open projects
JS
  
Bugs
Development

No branches or pull requests

3 participants