Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Angular compiler-cli issue #68

Closed
ghost opened this issue Sep 5, 2016 · 5 comments
Closed

Angular compiler-cli issue #68

ghost opened this issue Sep 5, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 5, 2016

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: yabab-dev/ng2-ckeditor#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
@n-sviridenko
Copy link

+1

@ghost
Copy link
Author

ghost commented Sep 17, 2016

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

@Gp2mv3
Copy link

Gp2mv3 commented Oct 1, 2016

I have the same issue with ionic2-RC0 (using AoT).

@urish urish closed this as completed in f100a33 Oct 1, 2016
@urish
Copy link
Owner

urish commented Oct 1, 2016

Released a fix in 1.0.0-beta.2

@Gp2mv3
Copy link

Gp2mv3 commented Oct 2, 2016

Thanks a lot !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants