Skip to content

Setup for monorepos with build steps (e.g. Typescript) no longer works with v10 and deploy #8975

@rslabbert

Description

@rslabbert

Last pnpm version that worked

9.15.4

pnpm version

10.0.0

Code to reproduce the issue

The steps for building a monorepo using deploy for versions <10 (as seen in the docs here) is:

  1. pnpm install
  2. pnpm run --recursive build
  3. pnpm deploy --filter=app1 --prod /prod/app1

Expected behavior

The install followed by build setup doesn't work with v10 anymore due to the requirement for inject-workspace-packages=true when using deploy. Because the build step happens after the install step, the built files don't show up in the previously installed dependencies.

For us this manifests in the build step failing because types from previously built packages are not available in later packages. This happens when using docker builds but also for general development (as updates to dependencies are no longer reflected). This means that, as far as I understand it, one of the following is required:

  1. Stop using deploy to avoid inject-workspace-packages=true;
  2. Add a postinstall step to all packages to build them and ensure they are reinstalled whenever the files change (which means having a watch step that reinstalls instead of for example just doing tsc --watch); or
  3. Change the inject-workspace-packages=true setting inside of the docker build but use linking instead of injecting by default.

Actual behavior

I'm not sure whether this is the intended behaviour or if I might be missing something. Currently we stopped trialing v10 until we find a solution. If this is the expected approach, then the only remediation here is to update the recipes section of the docs to ensure it works correctly with v10. If there are other solutions than why I noted above them it might be worth ensuring that's captured in the docs (and most likely in the changelog as well).

Additional information

No response

Node.js version

v23.6.0

Operating System

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions