这是indexloc提供的服务,不要输入任何密码
Skip to content

Turborepo doesn't respect preferWorkspacePackages in pnpm configuration #10387

@juliusmarminge

Description

@juliusmarminge

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/juliusmarminge/turbo-respect-pnpm-configs

Which canary version will you have in your reproduction?

2.5.2-canary.0

Environment information


Expected behavior

Sometimes it's not beneficial to use workspace: protocol (e.g. for example apps you want anyone to be able to clone down and just run, you can't have references to workspace dependencies. But when developing inside your monorepo, you still want to use the local version.

pnpm allows this through preferWorkspacePackages which let's you specify the version without workspace: protocol and still use the local package instead of pulling from npm.

Actual behavior

unfortunately, it seems like turbo doesn't respect this. Possible a regression with PNPM 10 cause I believe this has worked before?

lint has a dependency on ^lint, and @repo/ui lint fails, but the other ones still runs:

Image

lockfile inspection shows that it is using a local link:

https://github.com/juliusmarminge/turbo-respect-pnpm-configs/blob/48fbb2f104a35c79ef6d3c31d747086e6cf6788f/pnpm-lock.yaml#L25

dry run:

Image

To Reproduce

Run pnpm lint in project root

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't workingneeds: triageNew issues get this label. Remove it after triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions