1

In my angular application after added below the font i am getting Module error.How to resolve this issue in angular.

app.component.css:

@font-face {
    font-family: GraublauWeb;
    font-weight: bold;
    src: url("./assets/font/GraublauWebBold.woff") format("woff");
}

Error:

./src/app/app.component.css - Error: Module Error (from ./node_modules/postcss-loader/dist/cjs.js): D:\project\star\src\app\app.component.css:7:43: Can't resolve './assets/font/GraublauWebBold.woff' in 'D:\project\star\src\app'

2 Answers 2

4

Use it like this, correct path:

@font-face {
font-family: GraublauWeb;
font-weight: bold;
src: url("/src/assets/font/GraublauWebBold.woff") format("woff");
}
Sign up to request clarification or add additional context in comments.

Comments

2

Have you check that "assest/font" exist?

Try "assets" instead of "assest":

src: url("./assets/font/GraublauWebBold.woff") format("woff");

or

src: url("/assets/font/GraublauWebBold.woff") format("woff");

2 Comments

assets?????????????
Yes, "assets". Can you navegate to your webapp, and check if you have something like 'D:\project\star\src\app\assets\font' with fonts inside?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.