Skip to content

[Bug]: Unable to parse patch resolutions #6798

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

Open
1 task done
mikeduminy opened this issue May 15, 2025 · 0 comments
Open
1 task done

[Bug]: Unable to parse patch resolutions #6798

mikeduminy opened this issue May 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mikeduminy
Copy link

mikeduminy commented May 15, 2025

Self-service

  • I'd be willing to implement a fix

Describe the bug

Using parseResolution from @yarnpkg/parsers I would expect to be able to parse any resolution field in the yarn.lock file, but this doesn't work when there is a patch involved.

To reproduce

import { parseResolution } from '@yarnpkg/parsers'

// resolution taken straight from yarn.lock
const resolution = "@apollo/client@patch:@apollo/client@npm%3A3.4.7#~/.yarn/patches/@apollo-client-npm-3.4.7-96e3ad79c6.patch::version=3.4.7&hash=fa051c"

parseResolution(resolution)

Throws this error:

SyntaxError: Expected [^/] or end of input but "/" found (line 1, column 48)

Environment

System:
    OS: macOS 15.4.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 22.12.0
    Yarn: 4.7.0
    npm: 10.9.0 - ~/.volta/tools/image/node/22.12.0/bin/npm
    bun: 1.2.13 - /opt/homebrew/bin/bun
  npmPackages:
    jest: ^29.5.0 => 29.5.0

Additional context

No response

@mikeduminy mikeduminy added the bug Something isn't working label May 15, 2025
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

1 participant