You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Publishing does not replace yarn workspace:* version #246
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?
@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 running changeset 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 what workspace:* provides, but then changesets breaks.
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)
The github-script step reads .changeset/pre.json and returns the tag (e.g. next), or falls back to latest if you're not in prerelease mode. The PUBLISH_TAG env var is then consumed by the ci-publish script. This avoids inlining commands directly in the publish field, 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.
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.
Activity
trivikr commentedon Jan 30, 2023
Looks like this issue was reported earlier, but no response:
Andarist commentedon Jan 31, 2023
This is being fixed by changesets/changesets#674 - unfortunately, I couldn't find time to finish that work.
mkurapov commentedon Mar 24, 2023
@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"adesso-os commentedon Mar 25, 2023
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.mkurapov commentedon Mar 29, 2023
@adesso-os
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)unional commentedon Jun 4, 2023
workspace:^arthurfiorette commentedon Oct 10, 2023
Hey folks! I could get everything working fine by using this custom release script:
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#L21
workspace:^, dependencies, scoped packages and github releases are working 🙏.arthurfiorette commentedon Mar 20, 2024
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:
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.
mattfysh commentedon Jun 23, 2024
why does the changeset tool only half-work with the workspace protocol? i.e. bumps during
versionbut doesn't support a subsequentpublish?Switch to CI publish command bun publish
Switch to CI publish command bun publish
davtha-aa commentedon Nov 17, 2025
I am using
[email protected]and getting workspace published withworkspace:*Installing package that has been published.
GitHub Action
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.tianyingchun commentedon Nov 26, 2025
This problem has existed for a long time, and no one has gone to fix it.😂
[-]Publishing does not replace `workspace:*` version[/-][+]Publishing does not replace yarn `workspace:*` version[/+]bluwy commentedon Jun 25, 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.