wrong error reporting after migrating to v15

This issue has been created since 2022-11-18.

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

compiler, core

Is this a regression?

Yes

Description

I was able to run the project in v14 without problems, but after migrating to v15 I found some template errors iwhich I was they are wrong.

1-

 <img
      *ngIf="data.author?.image"
      mat-card-avatar
      src="{{ data.author.image }}"
      alt="{{ data.author.name || null }}"
    />

in this snippet, there is an *ngIf directive that checks that data.author?.image exists, which also implies that data.author exists.

but the compiler complains that data.author is possibly undefined
New Bitmap Image

2- in the same template, this error occures NG8001: 'mat-card' is not a known element: which means that MatCardModule doesn't imported

but it is wrong because the module that declares this component imports MatCardModule

reproduction
be sure you are at the branch 'upgrade-to-angular-15'

1- goto this file

this template is a part of the component card.component.ts which is declared in the module ngx-content-view-mat.module.ts

New Bitmap Image

this error gone when I remove commonModule from NgxContentViewMatModule

Please provide a link to a minimal reproduction of the bug

https://github.com/eng-dibo/dibo/blob/upgrade-to-angular-15/packages/ngx-content-view-mat/src/cards.component/cards.component.html#L3

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular 15

Anything else?

No response

JoostK wrote this answer on 2022-11-23

Duplicate of #47077.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-12-01
Star Count 85220
Watcher Count 3042
Fork Count 22607
Issue Count 1316

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Add preset jest configuration 0 2022-04-24 2022-11-10
RUSEFI virtual drive to spell out firmware version 0 2022-08-18 2022-08-18
File not found in `UpgradeFromPriorFeatureVersionCloudStorageTest.test_rolling_upgrade` 1 2022-10-28 2022-11-03
Lights don't update after smoke screen and stay dark forever 0 2022-09-24 2022-10-14
Filtres de censure 7 2020-10-05 2021-12-25
problemes Anime 6 2020-10-04 2021-12-25
[BUG] Installer asks for administrator rights when installing 'just for me' 3 2021-08-27 2022-01-23
ZMQ jll for Apple Silicon platform needed 3 2021-06-18 2022-11-19
Repair artifacts caused by conversion of font characters from 2048 unit design space to 1000 unit design space 1 2020-11-23 2022-11-23
notice of concern DIF-TOIP 3 2021-06-23 2022-06-14
Editorial Sprint 5 2021-06-28 2021-12-22
Show transaction TX on success 0 2020-11-18 2022-11-17
I start the server, errors appear and the server dies, and errors fly to the console.. 1 2021-03-26 2022-11-11
Pass attributes to create 3 2022-10-23 2022-11-24
Not Utilizing Processing Power 1 2022-08-09 2022-11-13
Adding Database From File That is Located Inside Linux Subsystem Fails [bug] 2 2021-12-26 2022-10-08
CP/M 3 extension compatibility 1 2020-11-19 2022-11-06
Request: Add CTS/RTS hardware flow control to terminal 1 2020-05-27 2022-11-06
[d84d6a] openrct2.exe: OpenRCT2::FileStream::FileStream, ObjectAsset::GetStream, OpenRCT2::RideAudio::StartRideMusicChannel, ... 0 2022-07-04 2022-09-30
Upgrade 11.0 3 2020-11-23 2022-01-14
Datasheet with dimensions please! 0 2022-04-25 2022-10-29
Package-lock.json shouldn't be gitignored 0 2021-06-23 2022-10-09
Combobox element text content not being announced in Firefox. 3 2022-07-25 2022-10-09
Nuget platform - current version 1 2022-08-26 2022-11-21
Results not getting stored in PostgreSQL 1 2022-08-24 2022-11-21
.NET Console project spawning an Angular application 1 2022-08-17 2022-11-21
The Web Template seems not correct. 2 2022-11-24 2022-11-22
Save/publish actions not where this article describes 1 2022-11-22 2022-11-22
Title reads "formContext.ui Tab Sections", when object is named "Section" 2 2022-11-22 2022-11-22
Calling .setNotification() on a hidden control 3 2022-11-22 2022-11-22
Search for products by SKU in Mobile App 1 2022-07-19 2022-11-04
Support for newest version of terraform 2 2019-10-18 2022-11-01
Add ability to import symbols from .debug files 3 2021-10-16 2022-10-14
Autenticador parou de funcionar 0 2021-10-19 2022-10-14
IBGP: LOCAL_PREF attribute not updated properly when +x or -x used in route-map applied at network 1 2022-06-04 2022-11-19
chore(deps): update dependency popper.js to v2.9.3 0 2021-08-03 2022-02-06
Android Studio always tried to import kotlin.Result 2 2022-11-03 2022-11-22
Swap files 1 2021-01-30 2022-01-03
Set Color of Title? 1 2018-10-05 2022-01-15
Lua filters: missing space in 'module not found' error message 0 2021-11-03 2022-10-31
[4.2] モーダルダイアログの終了ボタンの型が不正 1 2022-08-15 2022-09-30
Builds failing with node v16.13.0 on arm64 mac m1 2 2021-11-16 2022-09-03
[bug] ROS2 Daemon does not start automatically in a container 0 2022-04-26 2022-11-21
Add outpost_arn to aws_ec2_host resource/data lookup 2 2022-06-16 2022-09-23
Bug on the resource: azurerm_kubernetes_cluster, the argument automatic_channel_upgrade doesn't work has expected. 5 2022-07-13 2022-10-20
shellcheck file ignored 2 2022-03-03 2022-11-08
andorid app 跳转到二级界面中,点击Dokit 图标展开Dokit 界面背景变成透明的了 3 2021-11-05 2022-11-27
Build 953 for main with status FAILURE 2 2022-10-18 2022-10-20
create_metadata(datadir) RuntimeError 1 2020-02-23 2022-11-26
[Heartbeat] Remove monitor ID from states 1 2022-10-18 2022-10-30