angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

[BUG] - scss styles not found in v6

Open sfabriece opened this issue 8 years ago • 23 comments

Versions

<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->
Angular CLI: 6.0.0-beta.6
Node: 9.5.0
OS: win32 x64
Angular: 6.0.0-rc.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 6.0.0-beta.4
@angular/cli: 6.0.0-beta.6
@angular/material: 6.0.0-beta.4
@angular-devkit/architect: 0.0.7
@angular-devkit/build-optimizer: 0.4.6
@angular-devkit/build-webpack: 0.0.7
@angular-devkit/core: 0.4.6
@angular-devkit/schematics: 0.4.6
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 6.0.0-beta.6
@schematics/angular: 0.4.6
@schematics/package-update: 0.4.6
typescript: 2.7.2
webpack: 4.1.1

Repro steps

  1. create an angular project that uses scss

  2. add stylePreprocessorOptions to .angular-cli.json

    "stylePreprocessorOptions": {
         "includePaths": ["styles/"]
       },
    
  3. make a styles directory in src/

  4. add a _settings.scss file in src/styles directory

  5. import settings in styles.scss in src/

    @import 'settings';
    

Observed behavior

ERROR in ../node_modules/@angular-devkit/build-webpack/src/angular-cli-files/plugins/raw-css-loader.js!../node_modules/postcss-loader/lib??embedded!../node_modules/sass-loader/lib/loader.js??ref--14-3!./styles.scss
Module build failed:
@import 'settings';
^
      File to import not found or unreadable: settings.

Desired behavior

ng serve to work without errors

Mention any other details that might be useful (optional)

sfabriece avatar Mar 21 '18 13:03 sfabriece

npm install node-sass https://stackoverflow.com/questions/46419024/error-in-node-modules-css-loader

xavierluz avatar Jun 26 '19 12:06 xavierluz

for those upgrading to version 8 and finding that sass is broken:

yarn add node-sass fibers -D

as explained in the release notes for version 8

sfabriece avatar Jun 26 '19 13:06 sfabriece

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.