question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing types in compiler-cli

See original GitHub issue

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

When using @ngtools/webpack which uses @angular/compiler-cli typescript cannot build project when skipLibCheck is set to false.

Given errors are reported by typescript:

node_modules/@angular/compiler-cli/src/ngtsc/diagnostics/index.d.ts:10:10 - error TS2305: Module '"@angular/compiler-cli/src/ngtsc/diagnostics/src/error_code"' has no exported member 'COMPILER_ERRORS_WITH_GUIDES'.

10 export { COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL, ErrorCode, ngErrorCode } from './src/error_code';
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@angular/compiler-cli/src/ngtsc/diagnostics/index.d.ts:10:39 - error TS2305: Module '"@angular/compiler-cli/src/ngtsc/diagnostics/src/error_code"' has no exported member 'ERROR_DETAILS_PAGE_BASE_URL'.

10 export { COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL, ErrorCode, ngErrorCode } from './src/error_code';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@angular/compiler-cli/src/ngtsc/diagnostics/index.d.ts:10:79 - error TS2724: '"@angular/compiler-cli/src/ngtsc/diagnostics/src/error_code"' has no exported member named 'ngErrorCode'. Did you mean 'ErrorCode'?

10 export { COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL, ErrorCode, ngErrorCode } from './src/error_code';
                                                                                 ~~~~~~~~~~~

  node_modules/@angular/compiler-cli/src/ngtsc/diagnostics/src/error_code.d.ts:12:21
    12 export declare enum ErrorCode {
                           ~~~~~~~~~
    'ErrorCode' is declared here.

This error did not occur in previous version (12.1) and started to occur in 12.2

When i set skipLibCheck to true then it starts working, but we would like to keep checking libs.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Errors described in description

Please provide the environment you discovered this bug in

Angular: 12.2.0

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
CC84commented, Sep 3, 2021

I had the same issue after updating from 11 to 12. I commented out the whole project and it worked. Then tried step by step to comment everything in. I finally found this import: import {Environment} from “@angular/compiler-cli/src/ngtsc/typecheck/src/environment”;

For sure, i never added this one, it must have beend added by Webstorm. Removing this line fixed it.

1reaction
jeronecommented, Aug 22, 2021

Same issue. I don’t need any of the highlighted exports.

Using skipLibCheck: true in ‘tsconfig.json’ suppresses the issue, but a real fix is of course needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are the type definitions for 'Iterable', 'Set', 'Map' etc ...
The missing references were because of ReSharper not being able to find the definitions. I disabled the extension, and ordinary intellisense ...
Read more >
Ahead-of-time (AOT) compilation - Angular
The Angular ahead-of-time (AOT) compiler converts your Angular HTML and ... serve locally) CLI commands, the type of compilation (JIT or AOT) depends...
Read more >
The mypy command line - mypy 0.991 documentation
This flag makes mypy ignore all missing imports. It is equivalent to adding # type: ignore comments to all unresolved imports within your...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
Missing Node Type Definitions. One way is to try to use the CommonJs require syntax, so let's try that: ...
Read more >
Compiler Error C2065 - Microsoft Learn
... Example: C++/CLI type deduction failure; Example: C++/CLI attribute parameters. 'identifier' : undeclared identifier. The compiler can't ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found