-
Notifications
You must be signed in to change notification settings - Fork 12k
[BUG] - scss styles not found in v6 #10036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems to be a problem only after updating to 6.0.0-beta.6 |
Confirmed, same here. Won't work for |
Dupe of #10007 |
Workaround: add "stylePreprocessorOptions": {
"includePaths": ["./src/scss"]
} |
This worked for me: notice that I removed
|
Where in the angular.json do you guys add the stylePreprocessorOptions? |
@ciesielskico stylePreprocessirOptions go at the same level as styles, not in styles. Hope that helps. |
I have this now in my serve script:
but I'm getting the following error:
Can you post your |
@ciesielskico there you go: {
"$schema":
"./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-app": {
"root": "",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/my-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
},
{
"glob": "robots.txt",
"input": "src",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
],
"styles": [
{
"input": "src/styles.scss"
}
],
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
},
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"src": "src/environments/environment.ts",
"replaceWith": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "my-app:build"
},
"configurations": {
"production": {
"browserTarget": "my-app:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "my-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
{
"input": "styles.scss"
}
],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
}
}
},
"my-app-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"schematics": {
"@schematics/angular:component": {
"inlineStyle": true,
"inlineTemplate": true,
"flat": true,
"spec": true,
"prefix": "pre",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "pre"
}
}
}
|
@ciesielskico I noticed you have node_modules in your stylePreprocessorOptions change |
I'm having the same issue with importing sass files from node_modules, this seems to work only if you prefix your import statement with a tilde |
I find a workaround In
|
I have encountered this issue on @v6.0.6. I'm trying to import global scss variables into component's scss styles |
ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss) |
But what about JavaScript, from Node.js, which SOLUTION for this BUG? Can anyone help? Unfortunate in! |
Please, a solution that solves it, because it's been two weeks since I've tried to squeeze from ANDROID java Native to IONIC and this Bug is occurring. |
|
@FabioParigi Thank You!!!!! :D :D :D |
@itboygr |
npm install node-sass |
npm install node-sass |
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 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
create an angular project that uses
scss
add stylePreprocessorOptions to
.angular-cli.json
make a styles directory in src/
add a
_settings.scss
file in src/styles directoryimport settings in styles.scss in src/
Observed behavior
Desired behavior
ng serve to work without errors
Mention any other details that might be useful (optional)
The text was updated successfully, but these errors were encountered: