Skip to content

Angular 11.1.1 breaks source map for components with variable as an inline template #40854

@angelyordanov

Description

@angelyordanov

🐞 bug report

Affected Package

@angular/compiler-cli

Is this a regression?

Yes. 11.1.0 does not present the issue.

Description

This component source file

// test.component.ts

import { Component, OnInit } from '@angular/core';

const x = '<p>test works!</p>';
@Component({
  selector: 'app-test',
  template: x
})
export class TestComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
  }
}

when compiled with 11.1.1 looks like this in chrome

bad

instead of this

good

🔬 Minimal Reproduction

https://github.com/angelyordanov/angular-template-problem

🔥 Exception or Error

🌍 Your Environment

Angular Version:


Angular CLI: 11.1.1
Node: 14.4.0
OS: darwin x64

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: compilerIssues related to `ngc`, Angular's template compilerstate: has PR

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions