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: Fails to read package-lock.json entries without resolved field #295

Closed
gasinvein opened this issue Jun 22, 2022 · 0 comments · Fixed by #300
Closed

node: Fails to read package-lock.json entries without resolved field #295

gasinvein opened this issue Jun 22, 2022 · 0 comments · Fixed by #300

Comments

@gasinvein
Copy link
Member

flatpak-builder version

1.2.2

Linux distribution and version

Fedora 36

Affected flatpak-builder tool

node/flatpak-node-generator.py

flatpak-builder tool cli args

-r

Source repository URL

https://github.com/bitwarden/desktop.git

Flatpak-builder manifest URL

No response

Description

Seems like a regression introduced in #287, merged as part of #289
Quickfix is as simple as making the ResolvedSource.resolved property optional:

diff --git a/node/flatpak_node_generator/providers/npm.py b/node/flatpak_node_generator/providers/npm.py
index eeab9cf..e991884 100644
--- a/node/flatpak_node_generator/providers/npm.py
+++ b/node/flatpak_node_generator/providers/npm.py
@@ -65,7 +65,7 @@ class NpmLockfileProvider(LockfileProvider):
                 source = LocalSource(path=version[len('file:'):])
             else:
                 integrity = Integrity.parse(info['integrity'])
-                source = ResolvedSource(resolved=info['resolved'], integrity=integrity)
+                source = ResolvedSource(resolved=info.get('resolved'), integrity=integrity)
 
             yield Package(name=name, version=version, source=source, lockfile=lockfile)
 

although I'm not sure if it's a proper fix.

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.

1 participant