Repository navigation
Publishing does not replace yarn workspace:* version #246
Description
Activity
Looks like this issue was reported earlier, but no response:
Reacted by Ice and SNAXThis is being fixed by changesets/changesets#674 - unfortunately, I couldn't find time to finish that work.
Reacted by Trivikram Kamat and Terence@emmenko does it work if you replace
"package": "workspace:*"with the actual version of the workspace dependency, ie:"package": "workspace:1.0.0"? Changesets should end up bumping the workspace dependency version automatically when runningchangeset version, e.g."package": "workspace:1.0.1"When you specify the actual version number, then that version number is pulled during installation and placed into
node_modules. Usually, developers don't want that. They want the actual project from the other workspace linked into NM. That is whatworkspace:*provides, but thenchangesetsbreaks.then that version number is pulled during installation and placed into node_modules
This is true for
"package": "1.0.0", which will install from the registry, but it should still be linked locally if using the workspace protocol (while specifying a specific version), eg."package": "workspace:1.0.0". (unless I'm misunderstanding here)workspace:^Hey folks! I could get everything working fine by using this custom release script:
"ci:publish": "pnpm publish -r --access public && changeset tag",
In case someone actually wants to see it in action:
https://github.com/kitajs/kitajs/blob/e96dc95033e58c9a3a49ab8246ebc085b83a937b/.github/workflows/main.yml#L59
https://github.com/kitajs/kitajs/blob/e96dc95033e58c9a3a49ab8246ebc085b83a937b/package.json#L21workspace:^, dependencies, scoped packages and github releases are working 🙏.Reacted by Dinko MiletićUPDATE: This is how I made publishing in PNPM work with prereleases publishing to a custom npm tag.
In
package.json, define your publish script using a$PUBLISH_TAGenv var:{ "scripts": { "ci-publish": "pnpm publish -r --access public --tag $PUBLISH_TAG && changeset tag", "ci-version": "changeset version && pnpm install --no-frozen-lockfile" } }Then in your workflow, resolve the tag and pass it as an environment variable:
- name: Resolve publish tag id: publish-tag uses: actions/github-script@v8 with: result-encoding: string script: | const fs = require('fs'); try { return JSON.parse(fs.readFileSync('.changeset/pre.json', 'utf8')).tag; } catch { return 'latest'; } - name: Create Release Pull Request or Publish id: changesets uses: changesets/action@v1 with: version: pnpm ci-version commit: 'chore: update versions' title: 'Release plan' publish: pnpm ci-publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_CONFIG_PROVENANCE: true PUBLISH_TAG: ${{ steps.publish-tag.outputs.result }}
The
github-scriptstep reads.changeset/pre.jsonand returns the tag (e.g.next), or falls back tolatestif you're not in prerelease mode. ThePUBLISH_TAGenv var is then consumed by theci-publishscript. This avoids inlining commands directly in thepublishfield, which doesn't work reliably with multi-line values.Btw, don't try to inline the scripts, this action does not support && syntax and will fail during release.
why does the changeset tool only half-work with the workspace protocol? i.e. bumps during
versionbut doesn't support a subsequentpublish?- added 2 commits that reference this issue
on Oct 26, 2025 I am using
yarn@4.5.0and getting workspace published withworkspace:*Installing package that has been published.
npm i npm error code EUNSUPPORTEDPROTOCOL npm error Unsupported URL Type "workspace:": workspace:*
GitHub Action
- uses: changesets/action@v1 with: version: yarn changeset version publish: yarn release
My release script in root package.json:
{ "release": "turbo run build && changeset publish" }The version PR creation and Publishing works well. Just this last step of
workspace:*not being resolved to actual versions.Reacted by TerenceThis problem has existed for a long time, and no one has gone to fix it.😂
Reacted by tarnishablecReacted by Kranthi Lakum- marked Publishing of Yarn 2 workspaces won't remove version prefix #95 as a duplicate of this issue
on May 15, 2026 - changed the title
[-]Publishing does not replace `workspace:*` version[/-][+]Publishing does not replace yarn `workspace:*` version[/+]on May 15, 2026 I'm going to close this as this is a core changeset issue now using yarn to publish. I understand that it's frustrating that it's still not resolved today, but we're starting some work again at changesets/changesets#2097 that should help with this. See also changesets/changesets#674 for the previous PR with links to issues of this.
- added 2 commits that reference this issue
on Sep 15, 2026
Hi 👋
I started using the
workspace:protocol in one of my repos but noticed that when publishing the version didn't get replaced, ending up with a broken release.Is this a known issue? Is there anything that I'm missing that I need to configure?
Thanks
I'm using Yarn v3.
My github action is configured like this:
My Changesets config is configured like this.