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

[turborepo] Combination of pnpm non-monorepo and globalDependencies causes crash #4914

Closed
hugo-vrijswijk opened this issue May 12, 2023 · 0 comments · Fixed by #5002
Closed
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@hugo-vrijswijk
Copy link

hugo-vrijswijk commented May 12, 2023

What version of Turborepo are you using?

1.9.3

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

Having globalDependencies in a pnpm project that is not a workspace causes a crash:

 ERROR  run failed: failed to collect global hash inputs: /Users/hvanrijswijk1/ws/test/pnpm-workspace.yaml: open /Users/hvanrijswijk1/ws/test/pnpm-workspace.yaml: no such file or directory
Turbo error: failed to collect global hash inputs: /Users/hvanrijswijk1/ws/test/pnpm-workspace.yaml: open /Users/hvanrijswijk1/ws/test/pnpm-workspace.yaml: no such file or directory

Workaround: create an empty pnpm-workspace.yaml file, though that does change the pnpm-lock.yaml structure, or move globalDependencies to each task

Expected Behavior

No crash, same behaviour as without globalDependencies

To Reproduce

Empty pnpm project, with 1 task that 'echo's something to the terminal

{
  "$schema": "https://turbo.build/schema.json",
  "globalDependencies": ["myfile.json"],
  "pipeline": {
    "echo": {
      "inputs": ["package.json"]
    }
  }
}
$ turbo echo

Remove globalDependencies and observe no crash

Reproduction Repo

https://github.com/hugo-vrijswijk/turbo-globalDependencies-pnpm

@hugo-vrijswijk hugo-vrijswijk added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels May 12, 2023
chris-olszewski added a commit that referenced this issue May 18, 2023
)

### Description

Fixes #4914, this is the pnpm implementation of #4240

Was caused as `pnpm` when calculating ignores touches the file system
and will error if `pnpm-workspace.yaml` isn't present. This also avoids
failing on the rare case of someone using turbo on a single project with
no external dependencies as pnpm won't create a lockfile in this case.

### Testing Instructions

Added integration test for a single project using pnpm with global
dependencies

---------

Co-authored-by: Chris Olszewski <Chris Olszewski>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant