turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[ZERO-1537] Out of memory error with update to workspace file

Open jakeleventhal opened this issue 1 year ago • 2 comments
trafficstars

Verify canary release

  • [] I verified that the issue exists in the latest Turborepo canary release. I can't because of https://github.com/vercel/turbo/issues/7227

Link to code that reproduces this issue

A bit tricky given the nature of this

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

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

1.11.3 (newer versions have a bug with monorepos reported elsewhere)

Describe the Bug

My directory structure is:

package.json
apps/
   app1/
      package.json
      api/
         package.json
      client/
         package.json
   app2/
      package.json
      api/
         package.json
      client/
         package.json

My pnpm workspace file is

packages:
  - 'apps/*/*'

With this setup, if I want to run turbo commands within the apps/app1 directory, I get an error saying:

 ERROR  run failed: We did not find a package manager specified in your root package.json. Please set the "packageManager" property in your root package.json (https://nodejs.org/api/packages.html#packagemanager) or run `npx @turbo/codemod add-package-manager` in the root of your monorepo.

Running commands in the root, in apps/, or in apps/app1/client all seem to work fine.

To remedy this, I tried changing my pnpm-worksapce.yaml file to look like this:

packages:
  - 'apps/**'
  - '!**/.next'
  - '!**/.vercel'

This seems to work just fine. The problem though is then another one of my turbo commands fails (turbo vercel-link).

In my root package.json I have a script "vercel-link": "npx vercel link --repo --yes && pnpm -r pull-vercel". In my turbo.json, I have a simple task:

"//#vercel-link": {
  "cache": false
}

In each of my apps/<app>/*/package.json files, I have a simple script: "pull-vercel": "npx vercel pull --yes"

When I run this with the fix in my pnpm-workspace.yaml file, it just gets stuck here then eventually has an OOM error.

//:vercel-link: cache bypass, force executing 35ae3c940badc7db
//:vercel-link: 
//:vercel-link: > mycompany@ vercel-link /Users/jakeleventhal/Code/mycompany
//:vercel-link: > npx vercel link --repo --yes && pnpm -r pull-vercel
//:vercel-link: 
//:vercel-link: Vercel CLI 32.5.3
//:vercel-link: WARN! Did you mean to deploy the subdirectory "switch"? Use `vc --cwd switch` instead.
//:vercel-link: Fetching teams information
//:vercel-link: > No changes made
//:vercel-link: Vercel CLI 32.5.3
//:vercel-link: WARN! The `--repo` flag is in alpha, please report issues
//:vercel-link: Loading scopes…
//:vercel-link: Fetching Projects for [email protected]:mycompany/mycompany.git under mycompany…

Expected Behavior

This command should work as normal. Not sure if this bug is in turbo, or in vercel

To Reproduce

Follow steps described above

Additional context

No response

jakeleventhal avatar Feb 02 '24 15:02 jakeleventhal

At first glance, this looks to me like an issue with vercel. Can you try running npx vercel link --repo --yes without Turborepo? Does that have the same issue?

gsoltis avatar Feb 02 '24 19:02 gsoltis

Yeah, dumb lack of debugging steps on my end. I can confirm the issue is just that command. Seems to get screwed up when I update the workspace file as I did.

Tried to create a bug report in vercel/vercel but it prompted me to create a support case. Not sure if it makes sense to leave this issue open.

jakeleventhal avatar Feb 02 '24 20:02 jakeleventhal

Closing as this is an issue with the underlying command.

chris-olszewski avatar Apr 25 '24 23:04 chris-olszewski