Giter Club home page Giter Club logo

Comments (4)

gierschv avatar gierschv commented on June 15, 2024

+1, I have the same bug in one of my workspaces, worked perfectly with the last pnpm 8.15.7.

from pnpm.

nachoaldamav avatar nachoaldamav commented on June 15, 2024

Hi! in the package.json of @nighttrax/bar, is there any reason the local dependency is not specified with the workspace: prefix? If it's for package publishing, you can use pnpm publish and pnpm will remove the prefix in the published package. (same with pnpm pack)

{
  "dependencies": {
    "@nighttrax/foo": "workspace:~1.0.0"
  }
}

With this change, in my side the command runs correctly (it has an error in a nextjs app, but does not seem related to pnpm). Thanks in advance!

EDIT:
The reason for the issue in the v9 update is a breaking change. More information here.
link-workspace-packages is now false by default.

from pnpm.

NiGhTTraX avatar NiGhTTraX commented on June 15, 2024

@nachoaldamav thanks for spotting that, I guess it's just a relic from the beginning of the repo. Using the workspace: protocol does indeed fix the issue.

Regarding the link-workspace-packages breaking change, I think something else is breaking the behaviour of run -r. The lockfile suggests that the package is linked, and AFAICT pnpm i with v9 doesn't change that part of the lockfile while upgrading to the v9 format. Checking node_modules corroborates that. Moreover, building packages/foo manually before building packages/bar fixes the error, so it looks like an execution order problem with pnpm -r.

The use case from https://pnpm.io/workspaces fits my repo:

By default, pnpm will link packages from the workspace if the available packages match the declared ranges. For instance, [email protected] is linked into bar if bar has "foo": "^1.0.0" in its dependencies and [email protected] is in the workspace.

However, that only mentions linking, which seems to still work correctly in v9.

Since using workspace: fixes the problem, is there some other breaking change for v9 run -r that doesn't consider foo: ~1.0.0 a workspace dependency anymore?

Edit: hmm, setting link-workspace-packages=false makes run -r work as expected with v9. The docs seem misleading to me, as they talk about linking and node_modules, not about running scripts.

from pnpm.

gierschv avatar gierschv commented on June 15, 2024

EDIT: The reason for the issue in the v9 update is a breaking change. More information here. link-workspace-packages is now false by default.

@nachoaldamav Thanks for this, adjusting this option works for me 👍

I cannot switch (yet) to pnpm publish and workspace:* everywhere because semantic-release doesn't officially support pnpm to publish packages.

from pnpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.