Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration from 15.9.7 to 16.9.1 error Failed to run update-16-0-0-migrate-7 from @nrwl/storybook. #19361

Closed
1 of 4 tasks
madipta opened this issue Sep 28, 2023 · 6 comments · Fixed by #19743
Closed
1 of 4 tasks
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug

Comments

@madipta
Copy link

madipta commented Sep 28, 2023

Current Behavior

upgrading from 15.9.7 to 16.9.1

Expected Behavior

migration succes

GitHub Repo

https://github.com/madipta/offline-first

Steps to Reproduce

  1. git clone
  2. pnpm nx migrate latest (currently: 16.9.1)
  3. pnpm nx migrate --run-migrations

Nx Report

Node   : 18.15.0
   OS     : win32-x64
   pnpm   : 8.8.0

   nx                 : 16.9.1
   @nx/js             : 16.9.1
   @nx/jest           : 16.9.1
   @nx/linter         : 16.9.1
   @nx/workspace      : 16.9.1
   @nx/cypress        : 16.9.1
   @nx/devkit         : 16.9.1
   @nx/eslint-plugin  : 16.9.1
   @nx/nest           : 16.9.1
   @nx/node           : 16.9.1
   @nx/plugin         : 16.9.1
   @nx/react          : 16.9.1
   @nx/storybook      : 16.9.1
   @nrwl/tao          : 16.9.1
   @nx/web            : 16.9.1
   typescript         : 5.1.6

Failure Logs

ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "storybook@latest" not found

The Storybook CLI failed to upgrade your @storybook/* packages to the latest version.
   Please try running the sb upgrade command manually:
   pnpm exec storybook@latest upgrade

Failed to run update-16-0-0-migrate-7 from @nrwl/storybook. This workspace is NOT up to date!

Cannot convert undefined or null to object

Package Manager Version

8.8.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I tried manually pnpm exec storybook@latest upgrade, the same error message occured
Command "storybook@latest" not found

then I change to pnpx storybook@latest upgrade it work

run pnpm nx migrate --run-migrations again the same error occured

might be pnpm exec is not supported anymore?

@madipta
Copy link
Author

madipta commented Sep 28, 2023

error when I tried migrate from 15.9.7 to 16.0.0

Failed to run update-16-0-0-migrate-7 from @nrwl/storybook. This workspace is NOT up to date!

Cannot convert undefined or null to object

@madipta madipta changed the title migration from 15.9.2 to 16.9.1 error Failed to run update-16-0-0-migrate-7 from @nrwl/storybook. migration from 15.9.7 to 16.9.1 error Failed to run update-16-0-0-migrate-7 from @nrwl/storybook. Sep 28, 2023
@vprothais
Copy link

Hello,
I have the same result while migrating to nx 16.9.1 using yarn.
I think the command should be npx storybook@latest... instead of yarn storybook@latest... (or pnpm in your case) in order to download and execute storybook.

The same error occured twice during the process, while migrating to SB7 and then while thrying to automigrate projects.

I think the problem is linked to getPackageManagerCommand() called from callUpgrade and callAutoMigrate. It returns yarn or pnpm exec but it should be npx.

The Storybook migration documentation indicates to use pnpm dlx or yarn dlx but it's not available on all versions.

As a workaround you can execute failed command using npx, the storybook cli detects the package manager you use.

@AgentEnder AgentEnder added the scope: storybook Issues related to Storybook support in Nx label Sep 28, 2023
@vprothais
Copy link

I just found out it worked on nx version 16.5.5 as I did not have the problem with this version, it was still using npx.
The bug is linked to this PR by @meeroslav

@mandarini
Copy link
Member

Thank you for the detailed reports @vprothais ! We will look into it!

@meeroslav
Copy link
Contributor

@vprothais, the command cannot be npx ... because that would not work for yarn or pnpm with PnP.

The command being run is inaccurate, though. As you stated, it should be yarn dlx (or just yarn since that covers all grounds) and pnpm dlx.

It could be that there was some earlier compatibility where pnpm exec would understand to fallback to dlx but they removed that.

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants