thomasmunduchira / myq-api

An updated API to interface with myQ devices
https://www.npmjs.com/package/myq-api
MIT License
135 stars 39 forks source link

Pure React implementation issues #50

Open klappy opened 2 years ago

klappy commented 2 years ago

I'm implementing a pure front end usage and keep coming into polyfill errors.

Since this was intended to be used server side, I understand the usage of Node.js server side npm packages. However, I have been able to polyfill a few dependencies in my package.json via npm aliases:

    "crypto": "npm:crypto-browserify",
    "stream": "npm:stream-browserify",

I've gotten past those errors but now trying to figure out how to get past all of the stream_readable usages of buffer.

Any ideas or tips?

klappy commented 2 years ago

https://github.com/thomasmunduchira/myq-api/blob/2475098190e843e286a76acfc002869abb484e8a/src/MyQ.js#L3

This appears to be imported but I can't find it being used. I wonder if the issues could be resolved by removing this line? If not, where is it being used?

I plan to fork this library and test it without the import of crypto in the file and package.json. And if it’s needed try the browserify version.