john-osullivan / octokit-type-import-repro

Reproduction of a TS1205 bug found in @octokit/types via @octokit/auth-oauth-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import Error Reproduction

You can clone this repo and run:

$ npm i
$ npm run start

to verify an issue with the @octokit/types library when used with the --isolatedModules flag, which is required for babel & create-react-app (facebook/create-react-app#6054). I tested this on Typescript at 3.6.3 and 3.7.2.

This reproduction triggers the error with the following line in App.tsx:

import { Types } from '@octokit/auth-oauth-app';

If you trace it back, the import tree leads you to @octokit/types, where this export syntax in src/index.ts:

export { Name } from './Name';

leads to the issue above, but if it's updated to

export * from './Name'

then there are no errors. The files in @octokit/types/src all just import one type apiece, so it works out the same.

About

Reproduction of a TS1205 bug found in @octokit/types via @octokit/auth-oauth-app


Languages

Language:TypeScript 73.3%Language:HTML 19.2%Language:CSS 7.6%