Skip to content

-xi18n -p ./src/tsconfig.json fails due to scss import #3917

@CanKattwinkel

Description

@CanKattwinkel

OS?

Ubuntu 16.04

Versions.

angular-cli: 1.0.0-beta.24
node: 6.5.0
os: linux x64
@angular/common: 2.3.1
@angular/compiler: 2.3.1
@angular/compiler-cli: 2.3.1
@angular/core: 2.3.1
@angular/flex-layout: 2.0.0-beta.1
@angular/forms: 2.3.1
@angular/http: 2.3.1
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.3.1
@angular/platform-browser-dynamic: 2.3.1
@angular/router: 3.3.1

Repro steps.

Having something like @import '~@angular/material/core/theming/theming'; in a scss file is causing ./node_modules/.bin/ng-xi18n -p ./src/tsconfig.json to fail.

myI18nProject@0.0.0 i18n /home/user/projects/myI18nProject
ng-xi18n -p ./src/tsconfig.json

The log given by the failure.

Error: Compilation failed. Resource file not found: /home/user/projects/myI18nProject/src/app/calendar/calendar-toolbar/~@angular/material/core/theming/theming
    at ModuleResolutionHostAdapter.readResource (/home/user/projects/myI18nProject/node_modules/@angular/compiler-cli/src/compiler_host.js:232:19)
    at CompilerHost.loadResource (/home/user/projects/myI18nProject/node_modules/@angular/compiler-cli/src/compiler_host.js:200:85)
    at Object.get (/home/user/projects/myI18nProject/node_modules/@angular/compiler/bundles/compiler.umd.js:27048:105)
    at DirectiveNormalizer._fetch (/home/user/projects/myI18nProject/node_modules/@angular/compiler/bundles/compiler.umd.js:13277:45)
    at /home/user/projects/myI18nProject/node_modules/@angular/compiler/bundles/compiler.umd.js:13394:55
    at Array.map (native)
    at DirectiveNormalizer._loadMissingExternalStylesheets (/home/user/projects/myI18nProject/node_modules/@angular/compiler/bundles/compiler.umd.js:13394:16)
    at /home/user/projects/myI18nProject/node_modules/@angular/compiler/bundles/compiler.umd.js:13397:28
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:592:11)
Extraction failed

Mention any other details that might be useful.

Only affects scss files of components. import in the global src/style.scss works just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions