Skip to content

ERROR in Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl. #17728

Open
@mgechev

Description

@mgechev

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No

Description

When I change the templateUrl extension to .js or .ts, I'm getting:

ERROR in Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl.

This doesn't provide enough context (e.g., where the error occurred).

🔬 Minimal Reproduction

Create a new project and update the extension of the templateUrl for AppComponent to .ts or .js.

🔥 Exception or Error

ERROR in Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl.

🌍 Your Environment

v9.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions