Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure IoT Hub SDK Connection Issue #26987

Open
Skeletor11 opened this issue Nov 21, 2024 · 3 comments
Open

Azure IoT Hub SDK Connection Issue #26987

Skeletor11 opened this issue Nov 21, 2024 · 3 comments

Comments

@Skeletor11
Copy link

Version: Deno 2.0.6

I am trying to connect to the Azure IoT Hub SDK (https://www.npmjs.com/package/azure-iot-device-http) and am receiving the error below. Sample code can be found here:

https://github.com/fathym-deno/community-development/blob/main/tests/iot/csvToIot.ts

The line in question is #28
const client: Client = clientFromConnectionString(deviceConnectionString);

When running in debug mode, the line never gets hit before throwing the error, leading me to believe that is has something to do with the module being pulled in on load. Full stack trace below:

Uncaught TypeError TypeError: Cannot convert undefined or null to object
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typed-array-byte-offset\1.0.2\index.js:32:18)
at forEachArray (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\for-each\0.3.3\index.js:12:17)
at forEach (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\for-each\0.3.3\index.js:54:9)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typed-array-byte-offset\1.0.2\index.js:22:2)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typed-array-byte-offset\1.0.2\index.js:80:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\IsTypedArrayOutOfBounds.js:11:28)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\IsTypedArrayOutOfBounds.js:56:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\TypedArrayCreateFromConstructor.js:8:31)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\TypedArrayCreateFromConstructor.js:54:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\TypedArraySpeciesCreate.js:11:39)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\es-abstract\1.23.3\2024\TypedArraySpeciesCreate.js:39:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typedarray.prototype.slice\1.0.3\implementation.js:16:31)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typedarray.prototype.slice\1.0.3\implementation.js:94:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typedarray.prototype.slice\1.0.3\index.js:6:22)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\typedarray.prototype.slice\1.0.3\index.js:20:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\traverse\0.6.10\index.js:4:15)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\traverse\0.6.10\index.js:393:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\twin.js:8:18)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\twin.js:207:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\internal_client.js:15:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\internal_client.js:396:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\device_client.js:10:27)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\dist\device_client.js:319:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\device.js:47:11)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device\1.18.3\device.js:64:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device-http\1.14.3\index.js:6:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device-http\1.14.3\index.js:23:4)
at Module._compile (<node_internals>/module:736:34)
at Module._extensions..js (<node_internals>/module:757:11)
at Module.load (<node_internals>/module:655:32)
at Module._load (<node_internals>/module:523:13)
at Module.require (<node_internals>/module:674:19)
at require (<node_internals>/module:801:16)
at (c:\Users\kevin\AppData\Local\deno\npm\registry.npmjs.org\azure-iot-device-http\1.14.3\index.js:3:13)

@dsherret
Copy link
Member

Try running with --unstable-unsafe-proto https://docs.deno.com/runtime/reference/cli/unstable_flags/#--unstable-unsafe-proto

@dsherret
Copy link
Member

dsherret commented Nov 21, 2024

@dsherret
Copy link
Member

dsherret commented Nov 21, 2024

For some reason the has-proto package returns true for Deno https://github.com/inspect-js/has-proto/blob/main/index.js

Edit: I think it's because this only checks for if __proto__ is allowed for object creation and not after the fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants