angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.79k stars 11.98k forks source link

PostCSS Loader source map warning on 1.5.3 #8588

Closed Manduro closed 7 years ago

Manduro commented 7 years ago

Versions

Angular CLI: 1.5.3
Node: 8.8.1
OS: darwin x64
Angular: 5.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/cdk: 5.0.0-rc.1
@angular/cli: 1.5.3
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.0.0-rc.1
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.36
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.3
@schematics/angular: 0.1.5
typescript: 2.4.2
webpack-bundle-analyzer: 2.9.1
webpack: 3.8.1

Repro steps

Observed behavior

$ ng build -prod --sourcemaps

Date: 2017-11-22T08:26:59.254Z
Hash: d357235b34928b6e594c
Time: 87369ms
chunk {0} 0.a9c666a76436a070ac54.chunk.js, 0.a9c666a76436a070ac54.chunk.js.map (common) 43.4 kB  [rendered]
chunk {1} 1.f2c681144688266ea223.chunk.js, 1.f2c681144688266ea223.chunk.js.map () 14.2 kB  [rendered]
chunk {2} 2.d311243c8ae4d9d5cc31.chunk.js, 2.d311243c8ae4d9d5cc31.chunk.js.map () 125 kB  [rendered]
chunk {3} 3.b0b6119f7b13da976435.chunk.js, 3.b0b6119f7b13da976435.chunk.js.map () 58.7 kB  [rendered]
chunk {4} 4.49c20b84048ae9a1f544.chunk.js, 4.49c20b84048ae9a1f544.chunk.js.map () 15.6 kB  [rendered]
chunk {5} 5.f6b272d7cfa544730e6a.chunk.js, 5.f6b272d7cfa544730e6a.chunk.js.map () 8.55 kB  [rendered]
chunk {6} 6.ef38bde40865f3964d23.chunk.js, 6.ef38bde40865f3964d23.chunk.js.map () 73 kB  [rendered]
chunk {7} 7.d669fb930a4acbb0aa48.chunk.js, 7.d669fb930a4acbb0aa48.chunk.js.map () 3.47 kB  [rendered]
chunk {8} main.f2102377b70599afd302.bundle.js, main.f2102377b70599afd302.bundle.js.map (main) 887 kB [initial] [rendered]
chunk {9} polyfills.895bc7aebca2242f1abb.bundle.js, polyfills.895bc7aebca2242f1abb.bundle.js.map (polyfills) 40.3 kB [initial] [rendered]
chunk {10} styles.f4ceadfeb313281c50ba.bundle.css, styles.f4ceadfeb313281c50ba.bundle.css.map (styles) 48.4 kB [initial] [rendered]
chunk {11} inline.c4faebbeffb9946353ef.bundle.js, inline.c4faebbeffb9946353ef.bundle.js.map (inline) 1.71 kB [entry] [rendered]

WARNING in ./src/theme/global.scss
(Emitted value instead of an instance of Error) 

 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

NonErrorEmittedError: (Emitted value instead of an instance of Error) 

 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

    at Object.emitWarning (/node_modules/webpack/lib/NormalModule.js:117:16)
    at Promise.resolve.then.then (/node_modules/postcss-loader/lib/index.js:136:12)
    at <anonymous>
 @ multi ./src/theme/global.scss

Desired behavior

Resolved warning 😄

henetiriki commented 7 years ago

Could be due to missing sourceMap: cssSourceMap, in the options in object of the postcss-loader in packages/@angular/cli/models/webpack-configs/styles.ts (around line170).

Happy to create a PR.

Manduro commented 7 years ago

@ouq77 Correct! PR submitted.

asadsahi commented 7 years ago

For me it ended up in misleading error, is it right?


 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

NonErrorEmittedError: (Emitted value instead of an instance of Error)

 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

    at Object.emitWarning (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\webpack\lib\NormalModule.js:117:16)
    at Promise.resolve.then.then (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\postcss-loader\lib\index.js:136:12)
    at <anonymous>
 @ multi ./src/styles.scss ./node_modules/bootstrap/scss/bootstrap.scss ./node_modules/font-awesome/scss/font-awesome.scss

WARNING in ./node_modules/bootstrap/scss/bootstrap.scss
(Emitted value instead of an instance of Error)

 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

NonErrorEmittedError: (Emitted value instead of an instance of Error)

 ⚠️  PostCSS Loader

Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.

    at Object.emitWarning (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\webpack\lib\NormalModule.js:117:16)
    at Promise.resolve.then.then (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\postcss-loader\lib\index.js:136:12)
    at <anonymous>
 @ multi ./src/styles.scss ./node_modules/bootstrap/scss/bootstrap.scss ./node_modules/font-awesome/scss/font-awesome.scss

ERROR in ./src/main.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This likely means you have several @ngtools/webpack packages installed. You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies.
    at Object.ngcLoader (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\@ngtools\webpack\src\loader.js:458:19)
 @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This likely means you have several @ngtools/webpack packages installed. You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies.
    at Object.ngcLoader (C:\Users\asahi\AspNetCoreSpa\ClientApp\node_modules\@ngtools\webpack\src\loader.js:458:19)
 @ multi ./src/polyfills.ts

webpack: Failed to compile.
angular-automatic-lock-bot[bot] commented 5 years ago

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.