-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support AoT compilation #55
Comments
What version of angular2-chartist are you on? |
This is basically #48. As of now, I am not sure how to fix it. If you can point me to a module that works correctly, I can see what I am missing. Otherwise, I am not sure what I can do right now. |
Ah, sorry, I didn't look at the closed issues. Yes, that's the problem. Not sure if it is of any help but danbuchholz shares are list of working and non working libraries on his github. 3rd party libs mega test |
Maybe this could help: |
"every core angular package has an index.metadata.json file which is utilized by ngc during compilation. If you reference to this issue angular/angular#11262 They say that these metadata files are auto-generated by ngc. Maybe this comment above can help... |
I gave it a try on local copy of the module using the following tsconfig.json.
Compile is successfull, aot directory created including the *.ngfactory.ts but no metadata.json. I guess we need to wait until Will has time to look into this. |
@Paradox41 any news on this? |
Same as #48. I was unable to reproduce with a project of my own, the ngModule is being exported correctly. Until I can repro locally, not much I can do |
start a new ionic2 project and you will can reproduce this error |
I did that. Brand new, from scratch, no errors. |
What are the steps? You just start a new ionic2 project with RC2, and did a:
after: and import as a module:
only this? Any step more to work with ionic2? |
Literally copy and pasting from the docs and I get 0 errors. I even get type completion. |
with |
I get a different error in that case: cutePuppyPics → ionic run android
Running 'run:before' npm script before run
> ionic-hello-world@ build /Users/will/Projects/cutePuppyPics
> ionic-app-scripts build
[11:02:40] ionic-app-scripts 0.0.39
[11:02:40] build prod started ...
[11:02:40] clean started ...
[11:02:40] clean finished in 4 ms
[11:02:40] copy started ...
[11:02:40] ngc started ...
[11:02:40] copy finished in 34 ms
[11:02:40] lint started ...
[11:02:41] lint finished in 881 ms
[11:02:41] Error: Unexpected value 'ChartistModule' imported by the module 'AppModule'
[11:02:41] ngc failed
[11:02:41] ionic-app-script task: "build"
[11:02:41] Error: Error Even then, that doesn't seem like a bug here, that seems like a bug with |
I have the exact same error as you |
I was just going by the title of the thread. I would raise this with ionic if I were you. |
I think you need to change something in you lib structure to work with AoT Compilation... I don't know "Dan from Ionic here. We're going to provide some instructions to Angular library creators (and really any library creators) on how to distribute their dist directory with commonjs modules AND es2015 modules and link them up in the package.json using the main and module fields. Once this library follows the Angular convention, everything will just work. Expect that in the coming week or so. Thanks, |
Until that happens, nothing I can really do. I can make an update once those guidelines are released. |
Actually I don't think this is an Ionic specific issue but rather a generic Angular 2 one. I assume the current angular2-chartist module won't work in a pure Angular 2 AoT setup either. As far as I understand it would require changes to the angular2-chartist webpack configuration so it uses ngc to create the required .metadata.json. I tried to follow the examples given on webpack github but wasn't really able to incorporate the necessary changes. webpack/webpack#2918 |
Thanks for the link @jensstruemper. I will take a look. |
Seems that similar issues popping up in many other angular libraries since arrival of AoT. One blog post is mentioned in many conversations: angular-2-library-ready-for-aot |
While trying to fix this locally I stumbled over highcharts angular 2 wrapper which already fixed their AoT issues. Bigous/ng2-highcharts@ca85d35 |
Hi All,
|
@demirk4n been really busy lately, so I haven't had a chance to really dig in. I'll try and make some time this week or next. PRs are always welcome of course. |
@Paradox41 Thank you for your time.
I believe the issue revolves around the usage of |
@demirk4n you mind opening a PR with that work in progress? |
Sure, I hope it helps somehow. |
Any progress on this issue? I am also running into this. --dev works fine. When trying to do a ionic build with AoT I get this error: |
Still no progress on this. Just haven't had a chance. I'll try and take a look this week (as always, PRs welcome). Someone started something in #77 but hit a wall I think...might be worth taking a look. |
I just released 0.12.0 with an initial attempt at fixing this. Can anyone let me know if it works? |
just gave it a try by upgrading to latest Ionic 2.0.1 and angular-chartist-0.12.0 including most recent typings. No changes to source code. It won't compile:
|
Hi, I sort of fixed this myself by copying chartist.component.ts into my project and directly importing it into the app.module. I had to change // for angular-cli This is probably fixed in Angular 2.4.0: angular/angular#13473 |
@jensstruemper @bswg Typings were no longer being generated with |
definitely some change - the ionic build process passes but I get a white screen of death:
|
Track #94 for updates please |
Chartist working great now. However I finally wanted to migrate my code to the latest Ionic 2 RC1 (angular 2 final) and immediately bumped into a problem.
Not sure but it might be related to the module bundler ionic is using in context with AoT compiler Link. However if I use the
--dev
argument the JiT compiler should be used and the issue is supposed to go away for the price of a larger and slower app - but it doesn't. Some people suggest that external modules need to be made compliant for AoT....that's why I am raising it here again.My app.modules.ts:
Any idea?
The text was updated successfully, but these errors were encountered: