medikoo / serverless-plugin-reducer

Serverless plugin: Reduce Node.js lambda package so it contains only lambda dependencies
ISC License
14 stars 5 forks source link

Some node modules block the execution #3

Closed jerome-fox closed 5 years ago

jerome-fox commented 5 years ago

When I try to reduce a lambda using the 'mongoose' module or the 'redis' module, then the treatment blocks.

After some investigations, the plugin stops to these files:

node_modules/mongoose/lib/index.js node_modules/redis-parser/lib/hiredis.js

medikoo commented 5 years ago

Thanks @jerome-fox for report. We also observed that on our side (e.g. when trying to import pupetter).

I'll try to look into it shortly

jerome-fox commented 5 years ago

Thanks!

If it helps, my investigation stops in the module 'cjs-module' in the function 'getDirectDependencies'

medikoo commented 5 years ago

I coined one bug in deep dependency that was most likely responsible for that blocking

Please ensure that in your dependency tree you rely on deferred at v0.7.10 or greater (I'd also shortly update this package, so it ensures to rely fixed version).

medikoo commented 5 years ago

I double checked, and there was also issue in other dependency (find-requires).

It's fixed now, and I released new version of this package to ensure it gets fixed dependencies.

Additionally tests with solid coverage were added.

Be sure to rely on ^3.1.1