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.

Compiler doesn't compile when using exactOptionalPropertyTypes

See original GitHub issue

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

compiler

Is this a regression?

No

Description

When bootstrapping a new project and setting "exactOptionalPropertyTypes": true in the TypeScript configuration, the project will not compile.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Error: node_modules/@angular/compiler/src/render3/view/template.d.ts:229:22 - error TS2420: Class 'BindingScope' incorrectly implements interface 'LocalResolver'.
  Types of property 'globals' are incompatible.
    Type 'Set<string> | undefined' is not assignable to type 'Set<string>'.
      Type 'undefined' is not assignable to type 'Set<string>'.

229 export declare class BindingScope implements LocalResolver {
                         ~~~~~~~~~~~~

Please provide the environment you discovered this bug in

Angular CLI: 13.0.1
Node: 16.11.0
Package Manager: npm 7.21.0
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1300.1 (cli-only)
@angular-devkit/core         13.0.1 (cli-only)
@angular-devkit/schematics   13.0.1 (cli-only)
@schematics/angular          13.0.1 (cli-only)

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
petebacondarwincommented, Nov 12, 2021

Actually re-opening because it will still be a problem until we release a new version of Angular built with 4.5.

0reactions
angular-automatic-lock-bot[bot]commented, Dec 30, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improving code quality in Typescript with compiler options
This article is part 2 of Improving Typescript code quality with compiler options. Here we will cover more options in the tsconfig.json file ......
Read more >
Type with optional properties that cannot be explicitly undefined
However, TypeScript 4.4 introduced the --exactOptionalPropertyTypes compiler option which, when enabled, will not let you write undefined to ...
Read more >
TSConfig Reference - Docs on every TSConfig option
With exactOptionalPropertyTypes enabled, TypeScript applies stricter rules around how it handles properties on type or interfaces which have a ? prefix.
Read more >
Support TypeScript tsconfig flag `exactOptionalPropertyTypes
json:compilerOptions.exactOptionalPropertyTypes set to true is not compatible with the exported types in .d.ts files from @babylonjs/core .
Read more >
Angular compilation restrictions overview
Recommendation: We encourage you to use this flag as soon as you start using Typescript 4.4+. Additional TS restrictions not included in strict ......
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