question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular compiler-cli issue

See original GitHub issue

Bug 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:

  1. Create a new angular project
  2. Import the MomentModule in the main module
  3. npm install --saveDev @angular/compiler-cli
  4. Add a script in package.json: "extract": "ng-xi18n"
  5. Open app.component.html and add the i18n attribute somewhere on some tag. E.g: <h1>App works!</h1> to <h1 i18n>App works!</h1>
  6. On project root, run npm run extract
  7. You should now get the error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Sep 17, 2016

By the way this also prevents one from using any of angulars AoT features

0reactions
Gp2mv3commented, Oct 2, 2016

Thanks a lot !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found