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

update from 1.6.3 to 1.6.4 breaks compiling of scss files as imports are not resolved anymore

Open maks187 opened this issue 8 years ago • 9 comments

Versions


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.4
Node: 8.9.3
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.4
@angular/cli: 1.6.4
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.0.4
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.25
@angular-devkit/schematics: 0.0.48
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.13
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  • Increased version of angular/cli from 1.6.3 to 1.6.4 in package.json

Observed behavior

* can't compile anymore, import paths like material-themes or material-design-icons are not found anymore
* @import '~material-design-icons/iconfont/material-icons.css';
* @import '~@angular/material/prebuilt-themes/indigo-pink.css';
* why?

Desired behavior

third version position is for bug-fixes:

info Color legend : "" : Major Update backward-incompatible updates "" : Minor Update backward-compatible features "" : Patch Update backward-compatible bug fixes

why you are doing breaking changes? are there any tests made at all? thanks to we do already keep fixed versions without "^" and "~" prefixes.. most unsafe package management we worked with, that's bad :(

Mention any other details that might be useful (optional)

maks187 avatar Jan 15 '18 10:01 maks187

I believe this is fixed by https://github.com/angular/angular-cli/commit/aaca7d832e867e2345aa00d07c476e60dbd8b6f6

Wykks avatar Jan 15 '18 10:01 Wykks

@Wykks so in 1.7.0 then? when is the release of it (not the beta)? someone know, why it's now broken in a bug-fix release? thanks.

maks187 avatar Jan 15 '18 11:01 maks187

Please fix this in 1.6.4.

m-ghaoui avatar Jan 15 '18 11:01 m-ghaoui

@Wykks I think its broken again in 1.7.0-beta.0, can you please confirm it on your side?

I am receiving below error after upgrade.

ERROR in ./src/assets/styles/site.scss
Module build failed: Error: Can't resolve '~@angular/material/prebuilt-themes/indigo-pink.css' in 'D:\MyProject\src\assets\styles'

naveedahmed1 avatar Jan 15 '18 11:01 naveedahmed1

The fix is not included in 1.7.0-beta.0, you may downgrade to 1.6.3 until 1.6.5 is released

Wykks avatar Jan 15 '18 12:01 Wykks

If you remove the .css on the end the imports will work.

Webpack tries both .scss and .css when resolving the imports.

leon avatar Jan 15 '18 15:01 leon

CLI 1.6.5 will contain the fix (which is already in master). There are two options to correct this before the release:

  1. Remove the tilde (~).
  2. Use @import '../node_modules/@angular/material/prebuilt-themes/indigo-pink.css';. This will work on previous versions of the CLI as well.

Please also note that the tilde is a webpack specific identifier and should be avoided when possible to ensure transportability of the application code.

In regards to the '~material-design-icons/iconfont/material-icons.css'; import, the icons should ideally be referenced via the google font CDN to optimize application loading and caching. If this is not possible due to application restrictions, then an alternative option is to add it to the styles array of .angular-cli.json as ../node_modules/material-design-icons/iconfont/material-icons.css to ensure that any underlying assets are properly discovered.

clydin avatar Jan 15 '18 17:01 clydin

Closing this as it was fixed via #9188 and will be included in the next release as stated above by @clydin.

Brocco avatar Jan 15 '18 19:01 Brocco

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.