Source map not working for SCSS files
Recently I updated cli version 1.3.2 to 1.6.3 and after that I can't see scss source mapped file in developer tools in Chrome of Firefox .
Versions : 1.6.3
Angular CLI: 1.6.3
Node: 8.9.3
OS: win32 x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router
@angular/cli: 1.6.3
@angular/language-service: 4.4.6
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0
Repro steps
- Create new angular app using
ng new sample-app - Add scss file in angular-cli.json
"styles": ["styles/styles.scss"] - Launch app using
ng serve -sm -ec - Inspect styles using chrome dev-tools.
Observed behavior
No actual scss file, only style.bundle.css where all the styles compiled.

Desired behavior
Actual scss file can be seen in the developer tools with the line number

@clydin any update on this?
Source map not working for LESS files
I have the same issue with Less files too.
The component LESS files appear, but the styles brought in via the CLI are not.
Versions
Angular CLI: 1.6.2
Node: 6.11.2
OS: darwin x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.2
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.40
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.2
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack: 3.10.0
Dnia 5 stycznia 2018 04:42 Rukshan Lakshitha Dangalla <[email protected]> napisał(a): Recently I updated cli version 1.3.2 to 1.6.3 and after that I can't see scss source mapped file in developer tools in Chrome of Firefox . Versions : 1.6.3 Angular CLI: 1.6.3Node: 8.9.3OS: win32 x64Angular: 5.0.0... animations, common, compiler, compiler-cli, core, forms... http, platform-browser, platform-browser-dynamic... platform-server, router@angular/cli: 1.6.3@angular/language-service 4.4.6@angular-devkit/build-opt 0.0.36@angular-devkit/core: 0.0.22@angular-devkit/schemati 0.0.42@ngtools/json-schema: 1.1.0@ngtools/webpack: 1.9.3@schematics/angular: 0.1.11@schematics/schematics: 0.0.11typescript: 2.4.2webpack: 3.10.0 Repro steps Create new angular app using ng new sample-app Add scss file in angular-cli.json "styles": ["styles/styles.scss"] Launch app using ng serve -sm -ec Inspect styles using chrome dev-tools. Observed behavior No actual scss file, only style.bundle.css where all the styles compiled. zasobygwp.pl Desired behavior Actual scss file can be seen the developer tools with the line number zasobygwp.pl — You are receiving this because you are subscribed to this thread. Reply to this email directly, zasobygwp.pl view it on GitHub , or zasobygwp.pl mute the thread .
I've found that it is actually working for me, but just not for Bootstrap.
We're building bootstrap manually and therefore not using the default bootstrap.less found in the LESS folder.
It does not show references to my project's scss files nor to bootstrap 4's scss files. Only to styles.bundle.css.
My issues is with Bootstrap 3 and LESS
I've got a bootstrap.less (copy from ~/bootstrap/less/bootstrap.less) in my app folder that I've added to the angular-cli.json
Which when I run ng serve -sm -ec -env=mock shows source maps for my components but not for my complied global less files imported from the angular-cli.json
So the fix they mention about removing ~ will not work for me...
I am not even using ~ we use:
"styles": [
"../node_modules/prismjs/themes/prism.css",
"../node_modules/@ngx-loading-bar/core/loading-bar.css",
"../node_modules/ng2-toastr/bundles/ng2-toastr.min.css",
"sass/designsystem/designsystem.scss",
"styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.slim.js",
"../node_modules/popper.js/dist/umd//popper.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
The css is complied and works for all of these, but no source maps.
@smlombardi Yeah, seems like a bug from at least 1.6.2 onwards
I've had this problem from 1.5 onwards
As I can see many folks have this issue. What can we do about this?
1.6.5 didn't solve the issue for me. (LESS)
This is making it very hard to work and debug css styling issues.
Same issue here when I upgraded from 1.4.7 to 1.6.5. Please fix, this is a major blocker!
Still not working in 1.6.6, FWIW.
I have same issue, and still wait for fixing. This is a critical issue, it blocks rapid development.
This is main reason why I am still using Angular 4 and cli 1.4.x in production and not upgrading to Angular 5.
Some Context:
- using angular-cli version 1.6.6
- project is generated by the CLI.
- using Scss
I remembered it was a weird thing in Webpack config where I had to add extra config to allow sourcemap (in addition to the plugin config).
Solution:
In "node_modules@angular\cli\models\webpack-configs\common.js" file, in line 162, Add a line devtool: 'source-map', in the returned common configuration object in the getCommonConfig function, e.g.
...
catch (e) { }
return {
devtool: 'source-map', // add this line
resolve: {
extensions: ['.ts', '.js'],
...
Tested with the following Commands in terminal (also works with Sass @import):
ng serve // no sourcemap
ng serve -sm -ec // has sourcemap
ng serve --sourcemap --extract-css // has sourcemap
ng serve --sourcemap --extractCss // has sourcemap
@chaeusler Not working for me, 1.6.7
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve has an unknown property 'devtool'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
Proposed solution by @CharltonC works for me on v1.6.3 and v1.6.7 (two test projects I happen to have now). I am using scss @imports for bootstrap and material in styles.scss and I have proper source maps now. Exactly what I need. Thanks CharltonC!
@chaeusler @dmijatovic Am I missing something? When I add the line recommended, I get the above error, in short configuration.resolve has an unknown property 'devtool'
This is a standard install of 1.6.7