DanielGallo / GivEnergy-Smart-Home-Display

A web-based smart home display for showing live GivEnergy inverter data
1 stars 2 forks source link

punycode depreciation #5

Open britkat1980 opened 1 month ago

britkat1980 commented 1 month ago

v3 of GivTCP uses Alpine3.19 and is now giving a depreciation warning for punycode module:

(node:63) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
DanielGallo commented 1 month ago

@britkat1980 - I've made this pull request: https://github.com/britkat1980/giv_tcp/pull/259. This is to replace the serve npm module with http-server (to resolve the punycode error).

I also fixed the WebDashboard submodule - it was pointing to an outdated/nonexistent commit, causing it to render a really old version of the web dashboard.

I did a test build of GivTCP image locally, and the web dashboard renders with http-server but I couldn't fully test this - ports 6345, 6346, etc. for the inverter data aren't exposed by default. I also had to add port 3000 as being exposed so I could reach the web dashboard. Perhaps you can fully test it on your end?

britkat1980 commented 1 month ago

Thanks, that's working, but I get a different depreciation error:

(node:63) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated (Use node --trace-deprecation ... to show where the warning was created)

There's couple of tweaks needed to work with GivTCP v3, but I'll create a PR back with that shortly.

willholley commented 1 month ago

Is there any need to use node at runtime at all? If nginx can be used to serve the static site instead that removes the need to have node/npm in the runtime image completely and knocks a few hundred MB off the size.

I knocked up a quick prototype locally - happy to PR if there's interest.

britkat1980 commented 1 month ago

Always happy to slim down the image size. Send a PR over on the GivTCP repo

DanielGallo commented 1 month ago

The dashboard just needs something simple to render the static web content. @willholley your approach sounds good. Thanks!

willholley commented 1 month ago

Great - I filed a PR at https://github.com/britkat1980/giv_tcp/pull/283