Skip to content

Revert #11871 "Fix corepack packageManager detection on monorepos"#12099

Merged
EndangeredMassa merged 2 commits intomainfrom
revert-11871-revert-11865-revert-11811-corepath-debug
Sep 11, 2024
Merged

Revert #11871 "Fix corepack packageManager detection on monorepos"#12099
EndangeredMassa merged 2 commits intomainfrom
revert-11871-revert-11865-revert-11811-corepath-debug

Conversation

@EndangeredMassa
Copy link
Copy Markdown
Contributor

@EndangeredMassa EndangeredMassa commented Sep 11, 2024

@linear
Copy link
Copy Markdown

linear bot commented Sep 11, 2024

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 11, 2024

🦋 Changeset detected

Latest commit: f93e2fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@vercel/build-utils Patch
@vercel/hydrogen Patch
@vercel/next Patch
@vercel/redwood Patch
@vercel/remix-builder Patch
@vercel/static-build Patch
vercel Patch
@vercel/client Patch
@vercel/gatsby-plugin-vercel-builder Patch
@vercel/node Patch
@vercel-internals/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@EndangeredMassa EndangeredMassa changed the title Revert "Revert "Revert "Fix corepack packageManager detection on monorepos""" Revert #11871 "Fix corepack packageManager detection on monorepos" Sep 11, 2024
@EndangeredMassa EndangeredMassa merged commit 8e90f41 into main Sep 11, 2024
@EndangeredMassa EndangeredMassa deleted the revert-11871-revert-11865-revert-11811-corepath-debug branch September 11, 2024 15:39
EndangeredMassa pushed a commit that referenced this pull request Sep 11, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

## [email protected]

### Patch Changes

- Updated dependencies
\[[`8e90f4156`](8e90f41)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`8e90f4156`](8e90f41)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`8e90f4156`](8e90f41)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`8e90f4156`](8e90f41)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](#12099))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`8e90f4156`](8e90f41)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
onsclom added a commit that referenced this pull request Oct 3, 2024
## Problem

Turborepo does not pass `COREPACK_HOME` to internal libraries. This
means Turborepo projects using corepack may run into `EEXIST: file
already exists` errors. [[email protected] has `COREPACK_HOME` in default
passthrough](vercel/turborepo#9151), but we need
to handle older existing Turborepo projects better for a couple reasons:

1. New Turborepo projects can be created today that use corepack, and
they can hit this confusing `EEXIST` error.

2. We want to fix corepack detection in monorepos without breaking
existing Turborepo projects again.
  a. #12099

## Solution

When a Turborepo project does not support `COREPACK_HOME`, we disable
corepack. Projects that need corepack disabled have the following
criteria:
- Use turbopack (detected by having `turbo` in
`package.json#devDependencies`)
- Use a turbo version lower than 2.1.3 (using the minimum of the range
in `package.json#devDependencies.turbo`)
- Do not include `COREPACK_HOME` in `turbo.json#globalPassThroughEnv`

In the case we disable corepack, we display a helpful warning telling
users how to fix their project:

"Warning: Disabling corepack because it may break your project. To use
corepack, either upgrade to `[email protected]+` or include `COREPACK_HOME` in
`turbo.json#globalPassThroughEnv`."
onsclom added a commit that referenced this pull request Oct 4, 2024
…12219)

Reverting #12099

This change was originally reverted because Turborepo did not handle
corepack correctly. Now #12211
mitigates this problem.

---------

Co-authored-by: Trek Glowacki <[email protected]>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

## [email protected]

### Patch Changes

- Updated dependencies
\[[`9f3129fb0`](vercel/vercel@9f3129f)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9f3129fb0`](vercel/vercel@9f3129f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9f3129fb0`](vercel/vercel@9f3129f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9f3129fb0`](vercel/vercel@9f3129f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

## @vercel/[email protected]

### Patch Changes

- Revert "Revert "Revert "Fix corepack `packageManager` detection on
monorepos""" ([#12099](vercel/vercel#12099))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`9f3129fb0`](vercel/vercel@9f3129f)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
## Problem

Turborepo does not pass `COREPACK_HOME` to internal libraries. This
means Turborepo projects using corepack may run into `EEXIST: file
already exists` errors. [[email protected] has `COREPACK_HOME` in default
passthrough](vercel/turborepo#9151), but we need
to handle older existing Turborepo projects better for a couple reasons:

1. New Turborepo projects can be created today that use corepack, and
they can hit this confusing `EEXIST` error.

2. We want to fix corepack detection in monorepos without breaking
existing Turborepo projects again.
  a. vercel/vercel#12099

## Solution

When a Turborepo project does not support `COREPACK_HOME`, we disable
corepack. Projects that need corepack disabled have the following
criteria:
- Use turbopack (detected by having `turbo` in
`package.json#devDependencies`)
- Use a turbo version lower than 2.1.3 (using the minimum of the range
in `package.json#devDependencies.turbo`)
- Do not include `COREPACK_HOME` in `turbo.json#globalPassThroughEnv`

In the case we disable corepack, we display a helpful warning telling
users how to fix their project:

"Warning: Disabling corepack because it may break your project. To use
corepack, either upgrade to `[email protected]+` or include `COREPACK_HOME` in
`turbo.json#globalPassThroughEnv`."
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
…12219)

Reverting vercel/vercel#12099

This change was originally reverted because Turborepo did not handle
corepack correctly. Now vercel/vercel#12211
mitigates this problem.

---------

Co-authored-by: Trek Glowacki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants