1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

ng serve error when adding a new SCSS style within Angular application

Discussão em 'Angular' iniciado por Sun, Outubro 3, 2024.

  1. Sun

    Sun Guest

    I've create a brand new angular application using the CLI.

    I selected SCSS as the stylesheet choice.

    I type ng serve to run the application.

    Everything is OK at this point.

    I open the stylesheet and add any style

    e.g.

    body {
    background-color: red;
    }


    The website now fails to build and I have the following error in the console window:


    Error: ./src/app/pages/myMod.module.ts Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): NonErrorEmittedError: (Emitted value instead of an instance of Error) Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: expected "{". ╷ 12 │ body

    If I quit the ng serve and start it again it works.

    But it'll fail as soon as I add a new css rule.

    This is the latest version of node js and the CLI is also up to date.

    [​IMG]

    Continue reading...

Compartilhe esta Página