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

README refers to non-existant exported Action member #2094

Closed
icetortoise opened this issue May 14, 2021 · 7 comments
Closed

README refers to non-existant exported Action member #2094

icetortoise opened this issue May 14, 2021 · 7 comments
Labels
deno Type: Bug Something isn't working as documented Type: Documentation Improvements or additions to documentation

Comments

@icetortoise
Copy link

icetortoise commented May 14, 2021

I am trying out the deno example in the README, and it does not work:

➜  deno_play deno --version
deno 1.10.1 (release, x86_64-apple-darwin)
v8 9.1.269.27
typescript 4.2.2

➜  deno_play cat issues.ts
import { Octokit, App, Action} from "https://cdn.skypack.dev/octokit?dts";

const o = new Octokit();
console.warn(`${JSON.stringify(o)}`);

➜  deno_play deno run issues.ts
Check file:~/Downloads/deno_play/issues.ts
error: TS2614 [ERROR]: Module '"https://cdn.skypack.dev/-/octokit@v1.0.4-H4m6Ye7oYVoZwgWiDmFe/dist=es2020,mode=imports/optimized/octokit.js"' has no exported member 'Action'. Did you mean to use 'import Action from "https://cdn.skypack.dev/-/octokit@v1.0.4-H4m6Ye7oYVoZwgWiDmFe/dist=es2020,mode=imports/optimized/octokit.js"' instead?
import { Octokit, App, Action} from "https://cdn.skypack.dev/octokit?dts";
                       ~~~~~~
    at file:~/Downloads/deno_play/issues.ts:1:24
@wolfy1339 wolfy1339 added deno Type: Bug Something isn't working as documented Type: Documentation Improvements or additions to documentation and removed deno labels May 14, 2021
@wolfy1339
Copy link
Member

This isn't a bug with deno, but with our documentation. There isn't any Action client in octokit.js as of yet.

You can use @octokit/action in the mean time

@wolfy1339 wolfy1339 changed the title Deno example does not work README refers to non-existant exported Action member May 14, 2021
@icetortoise
Copy link
Author

OK, thanks for looking into this so quickly.

I am still seeing issues though, the script looks like this now:

import { Octokit, App} from "https://cdn.skypack.dev/octokit?dts";

const o = new Octokit();
console.warn(`${JSON.stringify(o)}`);

This prints

{"log":{},"rest":{"actions":{},"activity":{},"apps":{},"billing":{},"checks":{},"codeScanning":{},"codesOfConduct":{},"emojis":{},"enterpriseAdmin":{},"gists":{},"git":{},"gitignore":{},"interactions":{},"issues":{},"licenses":{},"markdown":{},"meta":{},"migrations":{},"orgs":{},"packages":{},"projects":{},"pulls":{},"rateLimit":{},"reactions":{},"repos":{},"search":{},"secretScanning":{},"teams":{},"users":{}},"retry":{}}

However, if I try to access o.projects I get compilation error saying such property does not exist.

It seems like the type definitions are not picked up by tsc?

@gr2m
Copy link
Contributor

gr2m commented May 14, 2021

it's o.rest.projects

@gr2m
Copy link
Contributor

gr2m commented May 14, 2021

Also note that there is a known problem with Deno right now, likely related to our dependency on Bottleneck, see the thread at #2075

@icetortoise
Copy link
Author

Thanks for the pointer.

o.rest.projects does not work either, compiler complains rest is missing in this case.

@gr2m
Copy link
Contributor

gr2m commented May 14, 2021

It does work in the browser:

import("https://cdn.skypack.dev/octokit").then(pkg => {
  const octokit = new pkg.Octokit()
  console.log(octokit.rest.projects)
})

so I assume it's probably related to the problem described at #2075

@gr2m
Copy link
Contributor

gr2m commented May 28, 2021

closing in favor of #2075

@gr2m gr2m closed this as completed May 28, 2021
@gr2m gr2m added the deno label May 28, 2021
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 Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants