Azure / azure-iot-hub-node

Azure IoT Hub Data Plane Node SDK
MIT License
2 stars 9 forks source link

Webpack compilation fails due to missing dependency #27

Open anttikes opened 1 year ago

anttikes commented 1 year ago

Context

Platform: Windows 10 Architecture: x64 NodeJS version: v18.12.1 Azure-iothub version: 1.16.4 Webpack version: 5.88.1

Problem description

When compiling a NodeJS application using azure-iothub package, an error is posted about a missing dependency ws. The error can be suppressed to make the compile pass but this will likely lead to a runtime error if a Websocket connection string is being used.

Reproduction steps

Attached to this report is a simple NodeJS application and attempting to build this application with npm install and npm run build causes the problem to appear. Uncommenting the section in externals causes the error to go away.

iothub-bug.zip

Probable root cause

The error is most probably caused by the fact that azure-iothub does not list ws as either an explicit or an optional dependency but does require it to be present in common-amqp/amqp.ts file, line 718.