Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

AOT #2

Open
chuckbeasley opened this issue Mar 27, 2017 · 6 comments
Open

AOT #2

chuckbeasley opened this issue Mar 27, 2017 · 6 comments

Comments

@chuckbeasley
Copy link

When will AOT be supported. Currently when attempting to compile a project using AOT, the following error is received: "Unexpected value 'Ng2TabModule in .../node_modules/ng2-tab/dist/index.d.ts' imported by the module 'AppModule in ...'. Please add a @NgModule annotation.

@allenhwkim
Copy link
Contributor

@chuckbeasley could you tell me how to reproduce the error from the begining?

@blattersturm
Copy link

Here's an example with angular-cli:

$ ng new repro-case-ngui-tab
$ cd repro-case-ngui-tab
$ npm install --save @ngui/tab
$ nano src/app/app.module.ts
# add these where needed:
# import { NguiTabModule } from '@ngui/tab'; // on top
# NguiTabModule // imports
$ ng build
# notice one gets the following error:
# ERROR in NguiTabModule is not an NgModule
$ ng build --prod
# notice one gets the following error:
# ERROR in Unexpected value 'NguiTabModule in ..../node_modules/@ngui/tab/dist/tab.module.d.ts' imported by the module 'AppModule in ..../src/app/app.module.ts'. Please add a @NgModule annotation.

This seems to be as the .d.ts file built by the TypeScript compiler lacks the decorators, and the compiler expects these to exist.

It turns out that the NPM package doesn't include the .metadata.json files, and this is confusing the compiler - building with a newer ngc should fix this, as I tried to locally build/pack (npm run build && npm pack) the package, and I ended up with the .metadata.json files included in the package..

@ghost
Copy link

ghost commented Oct 11, 2017

Are there any plans to fix this? Same issue.

@ghost
Copy link

ghost commented Nov 30, 2017

any update on this? This error is preventing me from building --prod version on Ionic 3.

I'm trying to include that missing .metadata.json file although I'm not sure how its contents should look like....

Please update.

@ghost
Copy link

ghost commented Nov 30, 2017

@blattersturm, would you be able to share a working .metada.json file for this component? or a full zip file containing .metadata.json file? please help. I have no idea what this metadata.json file should be...

@alc10485
Copy link

ERROR in : Unexpected value 'NguiTabModule in /Users/admin/Desktop/Angular/Tsupetot/node_modules/@ngui/tab/dist/tab.module.d.ts' imported by the module 'AppModule in /Users/admin/Desktop/Angular/Tsupetot/src/app/app.module.ts'. Please add a @NgModule annotation.

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

No branches or pull requests

4 participants