Angular compiler-cli issue
See original GitHub issueBug description
I localized my app using the i18n
attribute in a html tag. When I try to execute ng-xi18n
, I get the following error:
Error: Unexpected value 'MomentModule' imported by the module 'AppModule'
at /home/chris/workspace/my-webclient/node_modules/@angular/compiler/bundles/compiler.umd.js:14118:37
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (/home/chris/workspace/my-webclient/node_modules/@angular/compiler/bundles/compiler.umd.js:14103:46)
at /home/chris/workspace/my-webclient/node_modules/@angular/compiler/bundles/compiler.umd.js:12947:58
at Array.forEach (native)
at OfflineCompiler.analyzeModules (/home/chris/workspace/my-webclient/node_modules/@angular/compiler/bundles/compiler.umd.js:12946:21)
at Extractor.extract (/home/chris/workspace/my-webclient/node_modules/@angular/compiler-cli/src/extract_i18n.js:92:47)
at extract (/home/chris/workspace/my-webclient/node_modules/@angular/compiler-cli/src/extract_i18n.js:16:35)
at Object.main (/home/chris/workspace/my-webclient/node_modules/@angular/compiler-cli/node_modules/@angular/tsc-wrapped/src/main.js:30:16)
at Object.<anonymous> (/home/chris/workspace/my-webclient/node_modules/@angular/compiler-cli/src/extract_i18n.js:161:9)
Extraction failed
This seems to be strongly related: https://github.com/chymz/ng2-ckeditor/issues/36
Obviously compiler-cli
expects a .metadata.json
or something. Would be great if you could take a look at this.
To reproduce:
- Create a new angular project
- Import the
MomentModule
in the main module npm install --saveDev @angular/compiler-cli
- Add a script in
package.json
:"extract": "ng-xi18n"
- Open
app.component.html
and add thei18n
attribute somewhere on some tag. E.g:<h1>App works!</h1>
to<h1 i18n>App works!</h1>
- On project root, run
npm run extract
- You should now get the error
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Angular2 CLI error "@angular/compiler-cli" package was not ...
This error is not directly related to @angular/compiler-cli as it claims, but to @angular/cli, a misleading partially hardcoded and partially ...
Read more >The "@angular/compiler-cli" package was not properly installed.
I got this issue after I installed bootstrap@4.0.0-beta. After I ran 'npm install @angular/compiler-cli', the problem is solved. I assume it ...
Read more >angular/compiler-cli" package was not properly installed
I am unable to get an angular 4 project created with angular cli to compile. I get the following error. @angular/compiler-cli" package was...
Read more >@angular/compiler-cli - npm
@angular/compiler-cli. TypeScript icon, indicating that this package has built-in type declarations ... This package does not have a README. Add a ...
Read more >Angular compiler options
Command line optionslink. Most of the time you interact with the Angular Compiler indirectly using Angular CLI. When debugging certain issues, you might...
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 FreeTop 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
Top GitHub Comments
By the way this also prevents one from using any of angulars AoT features
Thanks a lot !