jgraph / drawio-desktop

Official electron build of draw.io
https://www.diagrams.net
Apache License 2.0
49.8k stars 4.96k forks source link

yarn.lock problems #1832

Open tleepa opened 1 month ago

tleepa commented 1 month ago

Preflight Checklist

Describe the bug I am trying to update flatpak build and in order to do so, I have to update the generated-sources.json using flatpak-node-generator.

Usually, it works just fine, but with 24.7.5 update, I am getting error:

❯ flatpak-node-generator yarn yarn.lock                                                     
Reading packages from lockfiles...
Traceback (most recent call last):
  File "/home/[redacted]/.local/bin/flatpak-node-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/[redacted]/.local/pipx/venvs/flatpak-node-generator/lib64/python3.12/site-packages/flatpak_node_generator/main.py", line 277, in main
    asyncio.run(_async_main())
  File "/usr/lib64/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/[redacted]/.local/pipx/venvs/flatpak-node-generator/lib64/python3.12/site-packages/flatpak_node_generator/main.py", line 198, in _async_main
    packages.update(lockfile_provider.process_lockfile(lockfile))
  File "/home/[redacted]/.local/pipx/venvs/flatpak-node-generator/lib64/python3.12/site-packages/flatpak_node_generator/providers/yarn.py", line 107, in process_lockfile
    yield self.process_package(lockfile, name_line, package)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/[redacted]/.local/pipx/venvs/flatpak-node-generator/lib64/python3.12/site-packages/flatpak_node_generator/providers/yarn.py", line 92, in process_package
    if self.is_git_version(entry['resolved']):
                           ~~~~~^^^^^^^^^^^^
KeyError: 'resolved'

It seems to me (but by all means, I am not a developer, so this is only my best guess), that yarn.lock is missing some data. Few packages do not have resolved and integrity properties:

Also, URLs point to registry.npmjs.org instead of previous registry.yarnpkg.com, but I am not sure if this is related.

To Reproduce Steps to reproduce the behavior:

  1. Install flatpak-node-generator
  2. Clone drawio-desktop repo
  3. Run flatpak-node-generator yarn yarn.lock
  4. See error

Expected behavior flatpak-node-generator should produce generated-sources.json without any errors.

Screenshots N/A

draw.io version (In the Help->About menu of the draw.io editor):

Desktop (please complete the following information):

Additional context N/A

davidjgraph commented 1 month ago

Does https://github.com/jgraph/drawio-desktop/commit/5bdfb0936b1eff9c4c3cd76ddfc86b36eb9aee49 fix that for you?

tleepa commented 1 month ago

Yes, running my command on dev branch is working fine.

tleepa commented 1 month ago

Can I ask, when this would be merged to release branch?

tleepa commented 2 weeks ago

Please, note that the problem is back after commit https://github.com/jgraph/drawio-desktop/commit/3ac88c4fef7d893654ce1ae0ec15b401bcf20df3 - would be great if this could be fixed before merging with release branch.

@m-mohamedin maybe you could look at this, since the problem occurred after your updates to yarn.lock?