1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular build error: Could not resolve "src/custom-theme.scss" — no import found in any...

Discussão em 'Angular' iniciado por Andrija Ursl, Julho 6, 2025.

  1. Andrija Ursl

    Andrija Ursl Guest

    I'm getting the following error when building my Angular project:

    Error: Could not resolve "src/custom-theme.scss"
    angular:styles/global:styles:1:8:
    1 │ @import 'src/custom-theme.scss';
    ╵ ~~~~~~~~~~~~~~~~~~~~~~~


    However, I have searched all my project files — including all .scss files, angular.json, and component styles — and there is no line importing or referencing src/custom-theme.scss. I have also removed and added the @angular/materials no change.

    I also checked:


    • angular.json styles array (no mention of custom-theme.scss)


    • All global stylesheets (src/styles.scss, src/styles/global.scss)


    • Any component or library SCSS files


    • I deleted node_modules, .angular cache, and rebuilt the project


    • Ran ng build with verbose logging to trace the error

    But Angular still tries to resolve this file and fails.

    The error message references angular:styles/global:styles:1:8 which points to a global styles file at line 1. I verified no import is in any global styles file.

    I suspect a cache or hidden reference, but can't find it.

    Where else could Angular be loading or referencing this SCSS import?

    How can I find or fully remove this hidden import so the build succeeds?

    Are there any Angular CLI, Material, or third-party configs that might inject this reference automatically?

    Continue reading...

Compartilhe esta Página