TypeScript Version: 3.1.0-dev.20180831
Search Terms:
TS2307 with direct file imports (imports that bypass an index)
Code
Starting from the yarn workspaces learn-a example, change pkg2/index.ts to import the pkg1/foo class directly.
Reproduction: https://github.com/rosskevin/learn-a/tree/yarn-workspaces-TS2307-direct-file-import
// import * as p1 from '@ryancavanaugh/pkg1'; // works
import { fn } from '@ryancavanaugh/pkg1/foo'; // does not work
export function fn4() {
// p1.fn();
fn();
}
yields:
packages/pkg2/src/index.ts:2:20 - error TS2307: Cannot find module '@ryancavanaugh/pkg1/foo'.
2 import { fn } from '@ryancavanaugh/pkg1/foo';
Expected behavior:
All direct paths are accessible, just like any standard file resolution.
Actual behavior:
error TS2307: Cannot find module '@ryancavanaugh/pkg1/foo'.
Related Issues:
#26819 is similar (may be the same) but it is focused on esnext usage
#25600
TypeScript Version: 3.1.0-dev.20180831
Search Terms:
TS2307 with direct file imports (imports that bypass an index)
Code
Starting from the yarn workspaces learn-a example, change
pkg2/index.tsto import thepkg1/fooclass directly.Reproduction: https://github.com/rosskevin/learn-a/tree/yarn-workspaces-TS2307-direct-file-import
yields:
Expected behavior:
All direct paths are accessible, just like any standard file resolution.
Actual behavior:
error TS2307: Cannot find module '@ryancavanaugh/pkg1/foo'.Related Issues:
#26819 is similar (may be the same) but it is focused on
esnextusage#25600