-xi18n -p ./src/tsconfig.json fails due to scss import
See original GitHub issueOS?
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.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ng-xi18n script is failing as it is inspecting scss / sass files
node_modules/.bin/ng-xi18n -p src/tsconfig.json as it described on github. ... requires to compile components and resolve components' styles imports.
Read more >baseUrl in tsconfig.json is ignored when resolving Sass ...
Imports in component specific sass files (e.g. app.component.scss ) are resolved relative to sourceRoot (i.e. src in this case), so that the following ......
Read more >i18n + Angular CLI + AOT - Daniele Ghidoli
"i18n" : "ng-xi18n -p src/tsconfig.json --i18nFormat=xmb" ... For example, I had to change the import paths of all my scss files from this: ......
Read more >Angular 5 Tutorial: Guide to Your First Angular 5 App - Toptal
Build a notes application from scratch for your first Angular 5 app. Learn Angular CLI, use RxJS, implement Firebase as the back-end, and...
Read more >ng-uikit-pro-standard SCSS - Material Design for Bootstrap
@import "~ng-uikit-pro-standard/assets/scss/mdb.scss"; To the file causes the following error. ERROR in ./src/styles.scss (.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m using this bash snippet for now, in order to remove all
scss
references before runningng-xi18n
. (and then to re-add them)Workaround:
use in project roots folder. Commit your changes, then run this script. It will remove all “styleUrls”-lines since they are not necessary for ng-xi18n command. After the
message.xlf
file is created/updated all other files will be reset to the last commit. Script will refuse to run if you have uncommitted changes.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.