When compiling my ionic2 app for android, I get this error:
ngc: Error: Unexpected value 'ChartsModule' imported by the module 'AppModule'
If I only build it using ionic serve (bypassing angular2 AOT) then it builds and runs fine.
I believe this error is due to the lack of metatdata.json file in the Telerik charts bundle (I only use the charts but I guess there's the same issue for other components).
Other vendors have the same problem, see ticket here: https://github.com/angular/angular/issues/11262
Could this be fixed ?
(I've reported this issue on StackOverflow but I thought I should open an issue here instead)
We're working on enabling AoT compilation for all components, including the Chart. You can track our progress in telerik/kendo-angular2#49
why was it closed ? is it supported now ? I just updated to 0.7.0 and I'm still getting the error.
Please, try cleaning your node_modules and reinstalling. What is the output of npm ls @progress/kendo-angular-charts?
yes, cleaning the node_modules folder did the trick regarding that error. However now I have the following error:
[12:22:25] bundle failed: Could not resolve '../../../../../../kendo-angular-popup/dist/npm/js/popup.component.ngfactory'
from C:\dev\ecdt-mobile\.tmp\node_modules\@progress\kendo-angular-charts\dist\npm\js\chart\tooltip\crosshair-tooltip.component.ngfactory.js
Hi @graphicsxp,
Thanks for noticing! Just pushed a fix and released a new version of the kendo-angular-charts package. Can you please try with version 0.7.1?
Yes, the build error is fixed now. My app does not run though. I have many warnings during build like these:
**[14:16:07] rollup: Export 'CrosshairTooltipsContainerComponent' is not defined by 'C:\dev\ecdt-mobile\.tmp\node_modules\@progress\kendo-angular-charts\dist\npm\js\chart.compone
nt.ngfactory.js' **
it is related to rollup, but not sure what the problem is.
So far we've only tried bundling with Webpack. Can you share your Rollup setup, ideally as a complete project, so we can debug it?
@tsvetomir my code is on github: https://github.com/graphicsxp/ecdt-mobile
Indeed, the issue seems to be due to rollup configuration. As we are using CommonJS modules you will need to set named exports for each of the warning entry. For example:
commonjs({
namedExports: {
'@progress/kendo-angular-charts': ['ChartsModule'],
'@progress/kendo-angular-intl/dist/npm/js/intl.service': ['IntlService'],
'@progress/kendo-angular-intl/dist/npm/js/cldr-intl.service': ['CldrIntlService'],
'@progress/kendo-angular-popup/dist/npm/js/popup.module': ["PopupModule"],
'@progress/kendo-angular-charts/dist/npm/js/charts.module': ['ChartsModule'],
'@progress/kendo-angular-charts/dist/npm/js/common/theme.service': ['ThemeService'],
'@progress/kendo-angular-charts/dist/npm/js/common/tooltip-template.service': ['TooltipTemplateService']
etc....
}
}),
This is discussed in this ionic repo thread you may be familiar with.
Also I have noticed that there is a newer version (0.0.37) of the @ionic/app-scripts package which seems to be using webpack. I guess there is some experimentation going on.
@rkonstantinov , thanks for pointing that out ! It seems indeed that ionic is moving back to webpack after moving to rollup in RC0. This is sick :p At least, that may improve the easiness of integrating kendo with my ionic app....
https://forum.ionicframework.com/t/help-us-test-webpack-support-in-ionic-2-app-scripts/67507
That's great news for us... not so much for the early adopters.
Most helpful comment
Indeed, the issue seems to be due to rollup configuration. As we are using CommonJS modules you will need to set named exports for each of the warning entry. For example:
This is discussed in this ionic repo thread you may be familiar with.
Also I have noticed that there is a newer version (0.0.37) of the
@ionic/app-scriptspackage which seems to be using webpack. I guess there is some experimentation going on.