joostfarla / serverless-cors-plugin

Serverless CORS Plugin - Managing Cross-origin resource sharing (CORS) policies
ISC License
70 stars 15 forks source link

lodash dependency causing _.pluck error in _createPreflightEndpoints #8

Closed broweaver closed 8 years ago

broweaver commented 8 years ago

Was seeing an error when trying to deploy - debugged it as a lodash error when trying to call _.pluck on line 141 of index.js in the _createPreflightEndpoints function.

Checking lodash documentation it seems they removed the _.pluck call in version 4.0.0 and your plugin calls for "lodash": "^4.0.0" which causes this error. I changed the lodash dependency to 3.10.1 and all works as expected.

joostfarla commented 8 years ago

@bondac thanks for reporting! Which version are you using? Version 0.2 (which is compatible with the latest Serverless version) does not contain any pluck statements anymore.

broweaver commented 8 years ago

@joostfarla Ah, our project had v0.1.1 of your plugin listed as the dependency - after updating to v0.1.2 it looks like this issue was already fixed as the lodash dependency reads "lodash": "^3.10.1" - apologies for not being thorough.

Our project is using the older version of serverless thus I can't at this time update to the latest version of this plugin.

Thanks for following up so quickly and pointing me in the right direction. Closing this issue as user error :)