In my case I had a component in a Shared module.
The component was loading and worked well but typescript was highlighting the html tag with red line and showed this error message.
Inside this component, I noticed I didn't import a rxjs operator.
import {map} from 'rxjs/operators';
When I added this import the error message disappeared.
Check all imports inside the component.
Hope it helps someone.