Skip to content

Use import {Octokit}#332

Merged
thboop merged 2 commits intoactions:masterfrom
nwtgck:patch-1
Feb 18, 2020
Merged

Use import {Octokit}#332
thboop merged 2 commits intoactions:masterfrom
nwtgck:patch-1

Conversation

@nwtgck
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown
Contributor

This resolves #333

Copy link
Copy Markdown
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