Skip to content

@ngtools crashes when using scss with ViewEncapsulation.None #2584

Closed
@qdouble

Description

@qdouble

Please provide us with the following information:

OS?

Mac OSX (Sierra)

Versions.

Using webpack repo from the test directory: https://github.com/angular/angular-cli/tree/master/tests/e2e/assets/webpack/test-app

Repro steps.

If you set ViewEncapsulation.None any component, like right here: https://github.com/qdouble/show-encapsulation-error/blob/master/app/app.component.ts#L9 and then run the webpack command it will crash. You can download the repo from that link if you want, the only thing that I changed is adding ViewEncapsulation.None

The log given by the failure.

ERROR in ./app/ngfactory/app/app.component.ngfactory.ts                             
Module build failed: Error: /Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-err
or/app/ngfactory/app/app.component.ngfactory.ts (17,27): Cannot find module '../../a
pp.component.scss'.)                                                                
    at _transpile (/Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-error/node_m
odules/@ngtools/webpack/src/loader.js:101:19)                                       
    at /Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-error/node_modules/@ngto
ols/webpack/src/loader.js:125:26                                                    
 @ ./app/ngfactory/app/app.module.ngfactory.ts 34:0-54                              
 @ ./app/main.aot.ts                                                                

ERROR in ./app/ngfactory/app/lazy.module.ngfactory.ts                               
Module build failed: Error: /Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-err
or/app/ngfactory/app/app.component.ngfactory.ts (17,27): Cannot find module '../../a
pp.component.scss'.)                                                                
    at _transpile (/Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-error/node_m
odules/@ngtools/webpack/src/loader.js:101:19)                                       
    at /Users/qdouble/Sites/EXAMPLE_APPS/show-encapsulation-error/node_modules/@ngto
ols/webpack/src/loader.js:125:26                                                    
 @ ./app/ngfactory async                                                            
 @ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js               
 @ ./app/ngfactory/app/app.module.ngfactory.ts                                      
 @ ./app/main.aot.ts 

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions