Title: Regression in 20.2 - New/incorrect build errors with 20.2 - Cannot use "||" with "??" without parentheses · Issue #63287 · angular/angular · GitHub
Open Graph Title: Regression in 20.2 - New/incorrect build errors with 20.2 - Cannot use "||" with "??" without parentheses · Issue #63287 · angular/angular
X Title: Regression in 20.2 - New/incorrect build errors with 20.2 - Cannot use "||" with "??" without parentheses · Issue #63287 · angular/angular
Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.1.6 Description This same code used to work but after updating to 20.2 latest I'm s...
Open Graph Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.1.6 Description This same code used to work...
X Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.1.6 Description This same code used to work...
Opengraph URL: https://github.com/angular/angular/issues/63287
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression in 20.2 - New/incorrect build errors with 20.2 - Cannot use \"||\" with \"??\" without parentheses","articleBody":"### Command\n\nbuild\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n20.1.6\n\n### Description\n\nThis same code used to work but after updating to 20.2 latest I'm seeing the following errors in a handful of places:\n\n> X [ERROR] Cannot use \"||\" with \"??\" without parentheses\n> Expressions of the form \"x ?? y || z\" are not allowed in JavaScript. You must disambiguate between \"(x ?? y) || z\" and \"x ?? (y || z)\" by adding parentheses.\n\nCouple of concerns:\n1. Should this be a breaking change like this?\n2. The error itself seems to come from the `.html` file but the error mentioned in the CLI appears to be a generated file/line numbers instead of my raw code.\n3. I do have parenthesis in my HTML file, so not sure what recourse I could have to fix this in user-land\n\n### Minimal Reproduction\n\nStackblitz:\nhttps://stackblitz.com/edit/stackblitz-starters-jsu7gzpr?file=src%2Fexample%2Fexample.component.ts\n\n```ts\nimport { Component, signal } from '@angular/core';\n\n@Component({\n standalone: true,\n selector: 'app-example',\n template: `\n \u003ch1>Example!\u003c/h1>\n {{ (someSignal() ?? false) || screenIsReadOnly() }}\n `,\n})\nexport class ExampleComponent {\n someSignal = signal\u003cboolean | undefined>(true);\n screenIsReadOnly = signal\u003cboolean | undefined>(false);\n}\n```\n\n### Exception or Error\n\n```text\n> X [ERROR] Cannot use \"||\" with \"??\" without parentheses\n> Expressions of the form \"x ?? y || z\" are not allowed in JavaScript. You must disambiguate between \"(x ?? y) || z\" and \"x ?? (y || z)\" by adding parentheses.\n```\n\n### Your Environment\n\n```text\nAngular CLI: 20.2.0\nNode: 20.19.1\nPackage Manager: npm 10.8.2\nOS: linux x64\n \n\nAngular: 20.2.0\n... animations, build, cli, common, compiler, compiler-cli, core\n... forms, platform-browser, router\n\nPackage Version\n------------------------------------\n@angular-devkit/architect 0.2002.0\n@angular-devkit/core 20.2.0\n@angular-devkit/schematics 20.2.0\n@schematics/angular 20.2.0\nrxjs 7.8.2\ntypescript 5.9.2\nzone.js 0.15.1\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/NateRadebaugh","@type":"Person","name":"NateRadebaugh"},"datePublished":"2025-08-20T15:42:26Z","url":"https://github.com/angular/angular/issues/63287"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f42123e7-3022-46cd-db31-ce8ae067fbad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C63A:3D8CBB:9B10BA:CE4B20:6B00E4F5 |
| html-safe-nonce | d8891e5e294f223e51ff358e14b55e07b430b30b33398c77c44815ee6ca47196 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjNBOjNEOENCQjo5QjEwQkE6Q0U0QjIwOjZCMDBFNEY1IiwidmlzaXRvcl9pZCI6IjgxMDEzMjE4MzU1NDg4Mjg5MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9331d7621bc2fc3af539c5a621ea00afb0acf633736f63be0201ff67eb90818e |
| hovercard-subject-tag | issue:3338634980 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/63287/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d8a84879702f79de70e30452c7c292e49fa98d534375c9912edc1a5f7cb08912/angular/angular/issues/63287 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d8a84879702f79de70e30452c7c292e49fa98d534375c9912edc1a5f7cb08912/angular/angular/issues/63287 |
| og:image:alt | Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.1.6 Description This same code used to work... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NateRadebaugh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width