angular: @angular/compiler-cli declarations bug: has no exported member 'NgTools_InternalApi_NG_2'

🐞 bug report

Affected Package

@angular/compiler-cli

Description

Wrong TypeScript declaration file.

πŸ”¬ Minimal Reproduction

package.json:

{
  "name": "compiler-cli-declarations-bug",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "@angular/compiler": "7.2.8",
    "@angular/compiler-cli": "7.2.8",
    "@types/node": "11.11.0",
    "typescript": "3.3.3333"
  }
}

index.ts:

import {readConfiguration} from "@angular/compiler-cli";

console.log(typeof readConfiguration);

Command to execute:

npx tsc --strict --noEmitOnError --lib es2015,dom index.ts

πŸ”₯ Exception or Error

node_modules/@angular/compiler-cli/index.d.ts:20:10 - error TS2305: Module '"@angular/compiler-cli/src/ngtools_api"' has no exported member 'NgTools_InternalApi_NG_2'.

20 export { NgTools_InternalApi_NG_2 as __NGTOOLS_PRIVATE_API_2 } from './src/ngtools_api';
            ~~~~~~~~~~~~~~~~~~~~~~~~

Found 2 errors.

img

Anything else relevant?

Adding --skipLibCheck TypeScript compiler option is a workaround:

npx tsc --strict --noEmitOnError --lib es2015,dom --skipLibCheck index.ts

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

The issue is still here with @angular/compiler-cli@8.2.6:

ERROR in ../../../node_modules/@angular/compiler-cli/index.d.ts:14:10 - error TS2305: Module '"@angular/compiler-cli/src/ngtools_api"' has no exported member 'NgTools_InternalApi_NG_2'.

14 export { NgTools_InternalApi_NG_2 as __NGTOOLS_PRIVATE_API_2 } from './src/ngtools_api';

I have typescript@3.1.1 & still getting the same error. Any progress with this issue?

I just have tried the 9.0.0-rc.3 release and the issue is gone. So closing as resolved.

Same error for us

same issue here with

"@angular/compiler": "7.2.0",
"@angular/compiler-cli": "7.2.8",
"typescript": "~3.2.2"

when running have this error on the console.

Typescript Error Module β€˜β€œ@angular/compiler-cli/src/ngtools_api”’ has no exported member β€˜NgTools_InternalApi_NG_2’.