Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Ng2Webstorage possibly causes error on angular i18n module #21

Closed
t4ss5t opened this issue Oct 14, 2016 · 5 comments
Closed

Ng2Webstorage possibly causes error on angular i18n module #21

t4ss5t opened this issue Oct 14, 2016 · 5 comments

Comments

@t4ss5t
Copy link

t4ss5t commented Oct 14, 2016

I just configured the built-in Angular i18n service to my project that uses Ng2Webstorage.

On calling "ng-xi18n", the following error occurs:

Error: Unexpected value 'Ng2Webstorage' imported by the module 'AppModule'
    at C:\Users\XYZ\node_modules\@angular\compiler\bundles\compiler.umd.js:14126:37
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (C:\XYZ\node_modules\@angular\compiler\bundles\compiler.umd.js:1411
1:46)
    at C:\Users\XYZ\node_modules\@angular\compiler\bundles\compiler.umd.js:12952:58
    at Array.forEach (native)
    at OfflineCompiler.analyzeModules (C:\XYZ\node_modules\@angular\compiler\bundles\compiler.umd.js:12951:21)
    at Extractor.extract (C:\XYZ\node_modules\@angular\compiler-cli\src\extract_i18n.js:92:47)
    at extract (C:\XYZ\node_modules\@angular\compiler-cli\src\extract_i18n.js:16:35)
    at Object.main (C:\XYZ\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
    at Object.<anonymous> (C:\XYZ\node_modules\@angular\compiler-cli\src\extract_i18n.js:160:9)
Extraction failed

Maybe it just a configuration mistake that I have done, but perhaps it is possible to add *.metadata.json files to fix the problem.

Can anyone evaluate this?

@PillowPillow
Copy link
Owner

Hi, i never encountered this error. Can you show me how you're importing the library?
I assume you're using angular-cli so webpack 2, am i right?

@t4ss5t
Copy link
Author

t4ss5t commented Oct 15, 2016

Hi,

yes i'm using angular-cli (beta-16), I think webpack is included.

I configured the xi18n tool according to this howto-guide: https://angular.io/docs/ts/latest/cookbook/i18n.html#!#create-a-translation-source-file-with-the-_ng-xi18n_-tool
I added the i18n directive to some HTML tags (like described in "Mark text with the i18n attribute") and finally started the ng-xi18n tool. As result the error occurs.

It seems that "angular2-moment" had a similar error: urish/ngx-moment#68 . That's where I found the approach with the *.metadata.json files.

@PillowPillow
Copy link
Owner

Hi, the v1.3.3 should fix your issue. Please let me know if you encounter any other issue.

@PillowPillow
Copy link
Owner

no news? I assume the problem was solved with the last build. I close this issue, feel free to open another if you want.

@t4ss5t
Copy link
Author

t4ss5t commented Oct 18, 2016

Sorry for my late response. I tested the new version successfully, the error has gone - Thank you!

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

No branches or pull requests

2 participants