Skip to content

Updated ensureCLIBinaryExists does not work properly with Yarn Berry (PnP) #5632

Closed as not planned

Description

@vhain

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.11.1

Framework Version

12.2.5

Link to Sentry event

N/A

Steps to Reproduce

https://yarnpkg.com/features/pnp

Latest ensureCLIBinaryExists() impl:

function ensureCLIBinaryExists(): boolean {
  for (const node_modulesPath of module.paths) {
    if (fs.existsSync(path.resolve(node_modulesPath, '@sentry/cli/sentry-cli'))) {
      return true;
    }
  }
  return false;
}

This has an issue with Yarn PnP:

  • Yarn PnP does not install things under node_modules/.
  • However it has helper functions in .pnp.cjs which wraps require.resolve, fs.* functions to work with their Zip archived dependency installations.
  • Thus path.resolve() is not able to find @sentry/cli/sentry-cli when they are installed with Yarn PnP.

I have found that ensureCLIBinaryExists() has following history of:

However the latest one does not work well with Yarn PnP. Currently we have downgraded sentry SDK to 7.7.0 mitigate this issue.

Expected Result

ensureCLIBinaryExists() returns true

Actual Result

ensureCLIBinaryExists() returns false even with @sentry/cli installed.

Activity

  1. github-actions commented on Sep 20, 2022

    @github-actions
    Contributor

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

  2. edoko commented on Sep 27, 2022

    @edoko

    I am also having the same issue.
    I'm using that commit as a temporary workaround until the issue is resolved.
    8a06b16

  3. lforst commented on Jan 7, 2023

    @lforst
    Contributor

    Hi, we updated the logic for this. Can you check if that fixed this issue?

  4. github-actions commented on Feb 8, 2023

    @github-actions
    Contributor

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions