Skip to content

Commit

Permalink
The UpgradeStorybookToSameVersionError is too flaky, so only logging …
Browse files Browse the repository at this point in the history
…it for now and continue the upgrade as normal
  • Loading branch information
kasperpeulen committed May 21, 2024
1 parent 84fa690 commit 7bff9d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion code/lib/cli/src/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ export const doUpgrade = async ({
if (!isCanary && lt(currentVersion, beforeVersion)) {
throw new UpgradeStorybookToLowerVersionError({ beforeVersion, currentVersion });
}

if (!isCanary && eq(currentVersion, beforeVersion)) {
throw new UpgradeStorybookToSameVersionError({ beforeVersion });
// Not throwing, as the beforeVersion calculation doesn't always work in monorepos.
logger.error(new UpgradeStorybookToSameVersionError({ beforeVersion }));
}

const [latestVersion, packageJson] = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-events/src/errors/server-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export class UpgradeStorybookToSameVersionError extends StorybookError {

template() {
return dedent`
You are trying to upgrade Storybook to the same version that is currently installed in the project, version ${this.data.beforeVersion}. This is not supported.
You are upgrading Storybook to the same version that is currently installed in the project, version ${this.data.beforeVersion}.
This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
Expand Down

0 comments on commit 7bff9d1

Please sign in to comment.