Skip to content

Compilation fails when using project references with tsc -b  #26867

@pragatisureka

Description

@pragatisureka

TypeScript Version: 3.1.0-dev.20180901

Typescript build fails when using tsc -b with project references. The generated .d.ts files in outDir fails to resolve relative imports imports

Another(consequence) issue is that extending an interface does not recognizes properties of super interface. As can be seen in the output below a.ts imports interface IT2 from which it extends with another property prop3 but the compiler fails to resolve relative reference in generated d.ts file and throws error.

Search Terms:
tsc build
project references

Code
https://github.com/pragatisureka/typescript-build-test

This repo is similar to https://github.com/RyanCavanaugh/project-references-outfile but without outFile

Expected behavior:
Build succeeds

Actual behavior:
Build fails

mainpkg/dist/a.d.ts:1:21 - error TS2307: Cannot find module './b'.

1 import { IT2 } from './b';
                      ~~~~~

pkg2/c.ts:6:9 - error TS2322: Type '{ prop1: string; prop2: string[]; prop3: number; }' is not assignable to type 'IT1'.
  Object literal may only specify known properties, but 'prop1' does not exist in type 'IT1'. Did you mean to write 'prop3'?

6         prop1: 'text',

Related Issues:
#26863
#26689

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions