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

Cannot check for firmware updates ... Cannot find package 'p-queue' #3953

Closed
3 tasks done
raineth opened this issue Oct 17, 2024 · 5 comments
Closed
3 tasks done

Cannot check for firmware updates ... Cannot find package 'p-queue' #3953

raineth opened this issue Oct 17, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@raineth
Copy link

raineth commented Oct 17, 2024

Checklist

  • I am not using Home Assistant. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog and my problem is not mentioned there.

Deploy method

Manually built (git clone - npm run build - npm install

Z-Wave JS UI version

9.23.0 (6420ee4)

ZwaveJS version

13.9.0

Describe the bug

The affected code seems to be in the node-zwave-js module but the bug reporting instructions there told me to report it here instead. Granted, these instructions tell me to file a bug against hass core, but I'm not doing that. I can reproduce without involving hass. I tried wiping my entire zwavejs2mqtt git repo and rebuilding from a fresh checkout, as I've occasionally had weird issues that npm run clean won't fix, but that didn't help.

When opening the "OTA Updates" section for any device in the zwave-js-ui, I receive the following messages in the UI and zwave-js-ui "log" (stderr):

2024-10-16T21:39:14.259610-04:00 hass zwave-js-ui[597913]: 2024-10-16 21:39:14.258 INFO Z-WAVE: Calling api getAvailableFirmwareUpdates with args: [ 6, { includePrereleases: false }, [length]: 2 ]
2024-10-16T21:39:14.294635-04:00 hass zwave-js-ui[597913]: 2024-10-16 21:39:14.292 INFO Z-WAVE: Cannot check for firmware updates for node 6: Cannot find package 'p-queue' imported from /snapshot/crap/zwavejs2mqtt/node_modules/zwave-js/build/lib/controller/FirmwareUpdateService.js
2024-10-16T21:39:14.294773-04:00 hass zwave-js-ui[597913]: Did you mean to import p-queue/dist/index.js? (ZW0261) getAvailableFirmwareUpdates undefined

These messages don't appear in the driver log, although the following similar one does:

2024-10-17T01:37:16.247Z DRIVER   Cannot find package 'got' imported from /snapshot/crap/zwavejs2mqtt/node_modul
                                  es/zwave-js/build/lib/driver/UpdateConfig.js
                                  Did you mean to import got/dist/source/index.js?

I don't do any NodeJS dev, so I'm a but out of my element here, but my guess is that this is somehow related to using Node 18 (blame Debian) which is still listed as supported.

There doesn't seem to be any other relevant information in the logs, but I'm happy to provide any additional information/test solutions as needed.

To Reproduce

  • Built from Git on Debian stable (or maybe just building with NodeJS 18 is enough)
  • Add a device if necessary
  • Open the "OTA Updates" section of any device
  • Receive error

Expected behavior

  • Receive a (possibly empty) list of updates instead of an error

Additional context

ii  nodejs                                                      18.19.0+dfsg-6~deb12u2                          amd64        evented I/O for V8 javascript - runtime executable
ii  npm                                                         9.2.0~ds1-1                                     all          package manager for Node.js
@raineth raineth added the bug Something isn't working label Oct 17, 2024
@robertsLando
Copy link
Member

Cannot find package 'got' imported from /snapshot/crap/zwavejs2mqtt/

is /snapshot a real folder on your system? Looks like you are using the pkg version and not a manually built one

@raineth
Copy link
Author

raineth commented Oct 17, 2024

I build on a different VM than I run zwave-js on, so I use the package.sh script to bundle the build into a binary and copy that over.

@robertsLando
Copy link
Member

so I use the package.sh script to bundle the build into a binary and copy that over.

The package flow changed, now there is the need to firstly create the esm bundle. I suggest you to use the builds you find in releases instead

@raineth
Copy link
Author

raineth commented Oct 17, 2024

I see. Thank you for that lead! That gave me enough info to research how to do the rest and I've built a functional pkg again.

Does the code path in package.sh for the non-$1 case (this else block) even still make sense? From this distance and with the context of your reply, it kind of looks like the official build processes never run that code anymore, but it's a huge red herring for someone who's an experienced developer but not with Node specifically. But I might be talking out my bum since I don't know Node or this codebase super well.

Would it make sense to mention the need to npm run bundle on the Git instructions? (I guess you only need to do that when creating a pkg'd version, but I'm probably not the only person who prefers to pkg my own builds to avoid having a full dev stack on my HomeAssistant VM.)

@robertsLando
Copy link
Member

Yeah that code isn't used anymore I just kept it there after I introduced the bundle in case there were some issues with it. Anyway git instructions only mention how to build your project to be run locally not how to create your own packaged binary, that's a really edge case usage IMO as most users will go for docker/snap/npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants