Azure / azure-iot-sdk-node

A Node.js SDK for connecting devices to Microsoft Azure IoT services
https://docs.microsoft.com/en-us/azure/iot-hub/
Other
261 stars 226 forks source link

Missing lodash.merge dependency in azure-iothub npm package version 1.16.3 #1195

Closed joost-lambregts closed 1 year ago

joost-lambregts commented 1 year ago

Context

Description of the issue

We are running an Azure Function on an app service plan that is running on an app service plan. The function runs into the following error:

Exception: Worker was unable to load function scheduleRequestHandler: 'Cannot find module 'lodash.merge'
Require stack:
- C:\home\site\wwwroot\node_modules\azure-iothub\dist\common-amqp\amqp.js
- C:\home\site\wwwroot\node_modules\azure-iothub\dist\amqp.js
- C:\home\site\wwwroot\node_modules\azure-iothub\dist\client.js
- C:\home\site\wwwroot\node_modules\azure-iothub\iothub.js
- C:\home\site\wwwroot\node_modules\@enecoiot\edge-command-handler\index.js
- C:\home\site\wwwroot\shared\steeringbox.js
- C:\home\site\wwwroot\scheduleRequestHandler\index.js
- C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js
- C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\nodejsWorker.js'

The problem seems pretty clear. Indeed, I can see that in version 1.16.3 an import of lodash.merge was added to dist\common-amqp\amqp.js, but this module is not added as a dependency in package.json. There is a depenency to lodash, but that is not to lodash.merge which is a seperate package.

lev-i commented 1 year ago

@joost-lambregts

This is an issue for azure-iot-hub-node, which we no longer hold ownership of. If you file this issue here, it should be an easy fix for them. I'll close this out, but if you have other issues feel free to re-open or file a new ticket.