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

[node] npm provider's generated-sources.json missing many packages (ENOTCACHED) #377

Closed
Tracked by #16
Ian2020 opened this issue Oct 13, 2023 · 0 comments · Fixed by #427
Closed
Tracked by #16

[node] npm provider's generated-sources.json missing many packages (ENOTCACHED) #377

Ian2020 opened this issue Oct 13, 2023 · 0 comments · Fixed by #427

Comments

@Ian2020
Copy link

Ian2020 commented Oct 13, 2023

flatpak-builder version

1.3.3

Linux distribution and version

Fedora 38

Affected flatpak-builder tool

node/flatpak-node-generator.py

flatpak-builder tool cli args

No response

Source repository URL

No response

Flatpak-builder manifest URL

No response

Description

I have found many sources are missing from generated-sources.json when using the npm provider (under certain conditions). When it comes to running the flatpak-builder you see something like this:

...
npm ERR! code ENOTCACHED
npm ERR! request to https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz failed: cache mode is 'only-if-cached' but no cached response is available.

I have a package-lock.json with over 1000 packages but flatpak-node-generator only produces 90 sources.

When I debugged the code of flatpak-node-generator I could see it was treating many packages' source as being of type LocalSource (which excludes them from generated sources) despite that not being the case. This is due (I believe) to a subtle bug in the code where if a package json file exists for a package in a local node_modules dir where flatpak-node-generator is run then the package will always be treated as local.

Deleting/renaming your node_modules dir before running flatpak-node-generator in the project's repository will workaround the issue but I am preparing a PR to fix the real issue also.

I believe this may also be the same bug as #244 which was closed when the OP switched to yarn.

@Ian2020 Ian2020 added the bug label Oct 13, 2023
p2004a added a commit to p2004a/info.beyondallreason.bar that referenced this issue Mar 3, 2024
As part of the update, I had to refactor quite a bit of how the build
process works.

flatpak-node-generator is quite bugged:
 - Output `generated-source.json` expects the package to be in the main
   directory, so I've split the build into modules but still had to add
   `flatpak-node` exclusion to build
 - I had to patch locally flatpak/flatpak-builder-tools#382
   and use that because flatpak/flatpak-builder-tools#381
 - I've also run into flatpak/flatpak-builder-tools#377

I've also:
 - Made copying of addr2line dependencies more reliable
 - Merged the startup scripts into one
 - Added permission and setup for discord so that rich presence works
p2004a added a commit to p2004a/info.beyondallreason.bar that referenced this issue Mar 3, 2024
As part of the update, I had to refactor quite a bit of how the build
process works.

flatpak-node-generator is quite bugged:
 - Output `generated-source.json` expects the package to be in the main
   directory, so I've split the build into modules but still had to add
   `flatpak-node` exclusion to build
 - I had to patch locally flatpak/flatpak-builder-tools#382
   and use that because flatpak/flatpak-builder-tools#381
 - I've also run into flatpak/flatpak-builder-tools#377

I've also:
 - Made copying of addr2line dependencies more reliable
 - Merged the startup scripts into one
 - Added permission and setup for discord so that rich presence works
p2004a added a commit to flathub/info.beyondallreason.bar that referenced this issue Mar 3, 2024
As part of the update, I had to refactor quite a bit of how the build
process works.

flatpak-node-generator is quite bugged:
 - Output `generated-source.json` expects the package to be in the main
   directory, so I've split the build into modules but still had to add
   `flatpak-node` exclusion to build
 - I had to patch locally flatpak/flatpak-builder-tools#382
   and use that because flatpak/flatpak-builder-tools#381
 - I've also run into flatpak/flatpak-builder-tools#377

I've also:
 - Made copying of addr2line dependencies more reliable
 - Merged the startup scripts into one
 - Added permission and setup for discord so that rich presence works
@hfiguiere hfiguiere added the node label Apr 5, 2024
julianfairfax added a commit to signalflatpak/signal that referenced this issue Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants