Closed
Description
TypeScript Version: 3.9.0-dev.20200413, 3.8.3
Search Terms: composite projects, declaration files, paths, reference, baseUrl
Code
- Download zip with the project ts-bug.zip
npm install
npm run build-non-composite
- it should be fine
Then, if you run npm run build
- there are 2 errors:
lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'.
2 export declare type Nominal<T, Name extends string> = MyNominal<T, Name>;
~~~~~~~~~
lib/src/common/nominal.d.ts:1:22 - error TS6053: File 'C:/projects/src/common/types.d.ts' not found.
1 /// <reference path="../../../src/common/types.d.ts" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And if you run npm run build-baseUrl
- there are another 2 errors:
lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'.
2 export declare type Nominal<T, Name extends string> = MyNominal<T, Name>;
~~~~~~~~~
lib/src/common/nominal.d.ts:1:23 - error TS2688: Cannot find type definition file for 'types'.
1 /// <reference types="types" />
~~~~~
This is pretty similar to #31696. In this case we have 2 bugs:
- For
npm run build
incorrect generated path forreference path
(it exits for 1 more folder). - For
npm run build-baseUrl
(which is differ frombuild
case in the onlybaseUrl
compiler option incommon
sub-project) incorrectly replacedrefernce path
withreference types
, so no project could use it because they might (and will) not have the samebaseUrl
option.