Ngx-infinite-scroll: npm package missing .metadata.json for angular 2 aot compiler?

Created on 5 Sep 2016  路  6Comments  路  Source: orizens/ngx-infinite-scroll

Tried to import and use aot compiler to compile.
Error: Unexpected value 'InfiniteScrollModule' imported by the module

info copied from valor-software/ng2-charts#391
angular/angular#11262 (comment)

angular/angular#11262 (comment)

angular/angular#11262 (comment)

Complete conversation (angular/angular#11262)

enhancement

Most helpful comment

@orizens thanks for reply, looking forward for angular2-infinite-scroll to upgrade and support AOT :-)
The rc5 release blog did mention aot

All 6 comments

hi @Zhuoqing
I think the case here is that angular2-infinite-scroll is currently based on the latest angular 2 RC5 - which doesn't include AOT.

@orizens thanks for reply, looking forward for angular2-infinite-scroll to upgrade and support AOT :-)
The rc5 release blog did mention aot

according to the blog post, AOT is consumed via the app module which consumes this module.
if you have more references - that can be helpful.
thanks.

Sorry the link for comment is broken when copied over.
"All referenced libraries must include the .metadata.json file along side any .d.ts files they produce otherwise they will not work correctly with ngc"
Seems just need to include the @angular/compiler-cli package, run ngc to build the project, and include the generated .metadata.json with each of the .d.ts file for npm packages.

https://github.com/angular/angular/issues/11262#issuecomment-244472000
https://github.com/angular/angular/issues/11262#issuecomment-244489405

I added those .metadata.json to my local npm folder and ngc compile works. but rollup tree shaking is reporting error. maybe due to the module format is not es2015. Any future plan to ship as es2015 module so rollup tree shaking works?

Export 'AxisResolver' is not defined by 'F:\prjnode_modules\angular2-infinite-scroll\src\axis-resolver.js'
Export 'InfiniteScrollModule' is not defined by 'F:\prjnode_modules\angular2-infinite-scroll\src\index.js'
Export 'InfiniteScrollModule' is not defined by 'F:\prjnode_modules\angular2-infinite-scroll\src\index.js'
Export 'AxisResolver' is not defined by 'F:\prjnode_modules\angular2-infinite-scroll\src\axis-resolver.js'
Module F:\prjnode_modules\angular2-infinite-scroll\angular2-infinite-scroll.js does not export InfiniteScrollModule
Error: Module F:\prjnode_modules\angular2-infinite-scroll\angular2-infinite-scroll.js does not export InfiniteScrollModule

Any news here?

Getting the following error in v0.2.7 with AOT:
Error: 'InfiniteScrollModule' is not exported by node_modules/angular2-infinite-scroll/angular2-infinite-scroll.js (imported by src/app/app.module.js). For help fixing this error see https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module

Is this issue definitely fixed?

Was this page helpful?
0 / 5 - 0 ratings