question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I use `pug` template in angular 6 project

See original GitHub issue

I’m submitting a…

I changed app.component.html as app.component.pug and modified that content, on terminal it showed

ERROR in ./src/app/app.component.pug 4:14
Module parse failed: Unexpected token (4:14)
You may need an appropriate loader to handle this file type.
| div(style='text-align:center')
|   h1
>     | Welcome to {{ title }}!
|   img(width='300', alt='Angular Logo', src='data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==')
| h2 Here are some links to help you start:
ℹ 「wdm」: Failed to compile.

Current behavior

Module parse failed: Unexpected token 「wdm」: Failed to compile.

Expected behavior

「wdm」: Compiled successfully.

Environment


Angular version: 6.1.0
 
For Tooling issues:
- Node version: 8.11.1
- Platform:  Mac

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
fengxinmingcommented, Sep 17, 2018

@benlesh anyway, thank you for the suggestion, I suppose it is time to migrate angular to vue.

8reactions
fengxinmingcommented, Sep 14, 2018

@ericmartinezr I don’t understand why you all support sass, stylus, less those style templates, but you didn’t support pug in @angular-devkit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using PUG (or Jade) templates with the Angular-CLI - Medium
Using PUG (or Jade) templates with the Angular-CLI ... Note: For Angular 6+ you can simply run ng add ng-cli-pug-loader to automatically run...
Read more >
Using Pug (Jade) with Angular (with CLI) - HackerNoon
First one, the simplest one, don't use pug, use HTML. · Run ng eject to eject the angular-cli. · Use other angular boilerplate...
Read more >
Pug support for Angular 2 / Angular 4 / Angular 6 / Angular cli ...
I saw many solutions, some of them: in each component was added something like "require!pug-loader()some.component.pug". Get away from using ...
Read more >
Pug-up your Angular markup - Thorsten Hans
When building SPAs using Angular or AngularJS, you use custom HTML markup extensions (aka directives) to instrument Angular how to render ...
Read more >
vscode-angular-pug - Visual Studio Marketplace
This plugin adds syntax highlighting for angular Pug template files in VS Code. It supports the angular syntax itself and HTML DOM events....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found