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

feat(ng2-cli): add *.metadata.json #933

Closed
n-sviridenko opened this issue Sep 6, 2016 · 7 comments
Closed

feat(ng2-cli): add *.metadata.json #933

n-sviridenko opened this issue Sep 6, 2016 · 7 comments

Comments

@n-sviridenko
Copy link

n-sviridenko commented Sep 6, 2016

Update by valorkin:

  • npm prepublish should generate metadata

When I'm try to launch ng-xi18n on rc6 via npm, I have this error:

$ ng-xi18n
Error: Unexpected value 'TypeaheadModule' imported by the module 'LocationModule'
    at /srv/app/node_modules/@angular/compiler/bundles/compiler.umd.js:14118:37
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/srv/app/node_modules/@angular/compiler/bundles/compiler.umd.js:14103:46)
    at /srv/app/node_modules/@angular/compiler/bundles/compiler.umd.js:12947:58
    at Array.forEach (native)
    at OfflineCompiler.analyzeModules (/srv/app/node_modules/@angular/compiler/bundles/compiler.umd.js:12946:21)
    at Extractor.extract (/srv/app/node_modules/@angular/compiler-cli/src/extract_i18n.js:92:47)
    at extract (/srv/app/node_modules/@angular/compiler-cli/src/extract_i18n.js:16:35)
    at Object.main (/srv/app/node_modules/@angular/tsc-wrapped/src/main.js:30:16)
    at Object.<anonymous> (/srv/app/node_modules/@angular/compiler-cli/src/extract_i18n.js:161:9)
Extraction failed
@n-sviridenko n-sviridenko changed the title Emergency, i18n extract [Emergency!!] i18n extract Sep 6, 2016
@n-sviridenko
Copy link
Author

The code of the LocationModule:

...
import { TypeaheadModule } from 'ng2-bootstrap';

@NgModule({
  imports: [
    ...,
    TypeaheadModule,
  ],
  ...
})
export class LocationModule {}

@Martin-Luft
Copy link
Contributor

Please try import { TypeaheadModule } from 'ng2-bootstrap/ng2-bootstrap';

@n-sviridenko
Copy link
Author

Unfortunately, the same behaviour.

@tamaracha
Copy link

I get the same behavior with compiler-cli by importing CollapseModule this way:

import { CollapseModule } from 'ng2-bootstrap/components/collapse';

and this way:

import { CollapseModule } from 'ng2-bootstrap/ng2-bootstrap';

It happens, when CollapseModule is included in NgModule imports array. In urish/ngx-moment#68 and yabab-dev/ng2-ckeditor#36 it is assumed, that a *.metadata.json is expected by compiler-cli. The angular packages contain them, ng2-bootstrap package does not.

@valorkin valorkin changed the title [Emergency!!] i18n extract feat(ng2-cli): add *.metadata.json Sep 12, 2016
@freezy
Copy link

freezy commented Sep 21, 2016

Any update on this? I've tried generating the metadata files, but it fails with Error encountered resolving symbol values statically. Expression form not supported for all the template literals used in the @Component definitions.

@otelnov
Copy link
Contributor

otelnov commented Sep 21, 2016

working on it. there are lot of es6 template literals I should change, no chance compile with it.

@raphaelmesquita
Copy link

Also, I noticed that some parts of the code just wont compile to js after building the transpiled typescript with ngc. Apparently this is because angular does not allow private or protected fields to be used in the template when compiling AoT. Are you guys aware of this issue?

valorkin pushed a commit that referenced this issue Oct 3, 2016
valorkin pushed a commit that referenced this issue Oct 3, 2016
jtomaszewski pushed a commit to jtomaszewski/ng2-bootstrap that referenced this issue Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants