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

Use import {Octokit} #332

Merged
merged 2 commits into from
Feb 18, 2020
Merged

Use import {Octokit} #332

merged 2 commits into from
Feb 18, 2020

Conversation

nwtgck
Copy link
Contributor

@nwtgck nwtgck commented Feb 4, 2020

Hi,

The purpose of this PR is to remove the following error.

node_modules/@actions/github/lib/github.d.ts:2:8 - error TS2613: Module '"/.../node_modules/@octokit/rest/index"' has no default export. Did you mean to use 'import { Octokit } from "/.../node_modules/@octokit/rest/index"' instead?

2 import Octokit from '@octokit/rest';
         ~~~~~~~

@xt0rted
Copy link
Contributor

xt0rted commented Feb 5, 2020

This change was made i n v16.43.1 but the version in package.json is v16.15.0 which is why all the builds failed.

@nwtgck
Copy link
Contributor Author

nwtgck commented Feb 5, 2020

@xt0rted Thanks! Umm... Interesting...

Actually, my project using @actions/github fails in build-time when import Octokit from '@octokit/rest'; is used. To avoid this, I manually modify .d.ts in node_modules: nwtgck/actions-netlify#2.

@nwtgck
Copy link
Contributor Author

nwtgck commented Feb 5, 2020

I found the reason.

16.43.1 (2020-02-03)
Bug Fixes
TypeScript: named { Octokit } export (486eadd)

https://github.com/octokit/rest.js/releases/tag/v16.43.1

@technote-space
Copy link

technote-space commented Feb 5, 2020

^16.15.0 = 16.x
so v16.43.1 is installed.
I think this PR needs to be merged as soon as possible.

If you want to build with tsc now, add skipLibCheck setting.

tsconfig.json

{
  "compilerOptions": {
    "skipLibCheck": true,

   ...

  }
}

@nwtgck
Copy link
Contributor Author

nwtgck commented Feb 5, 2020

@technote-space Thank you very much for your useful tip: skipLibCheck. I didn't know that.

Copy link

@hardboiled hardboiled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will definitely fix the problem I mentioned in my comment. Thanks for opening!

Copy link

@piraka9011 piraka9011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump! Can we get this in soon please!

@joshmgross
Copy link
Member

This resolves #333

Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

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 this pull request may close these issues.

8 participants