X Tutup
The Wayback Machine - https://web.archive.org/web/20201023164850/https://github.com/angular/angular-cli/issues/17728
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mgechev opened this issue May 15, 2020 · 2 comments
Open

Comments

@mgechev
Copy link
Member

@mgechev mgechev commented May 15, 2020

🐞 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

@BboyAkers
Copy link

@BboyAkers BboyAkers commented Jun 1, 2020

Updated an angular 7 app to angular 9.1.9. Received this error. Any solutions or suggestions to better debug this? 🙂

@mgechev
Copy link
Member Author

@mgechev mgechev commented Jun 1, 2020

Make sure the styles and/or template you reference in your component have .css/.html extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.
X Tutup