nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.61k stars 2.36k forks source link

Migration to 19.6.2 - Storybook 8 fails #27631

Open ghost opened 2 months ago

ghost commented 2 months ago

Current Behavior

Migration fails due to Storybook 8 migration. It adds getAbsolutePath function which searches for package.json, however, @nx/react/plugins/storybook does not have a package.json and therefore it fails.

Expected Behavior

Should not append getAbsolutePath to @nx/react/plugins/storybook I assume (?) and migration should pass.

GitHub Repo

No response

Steps to Reproduce

  1. Create a workspace in v19.0.0
  2. Add a project with a storybook configuration, using react-webpack5
  3. Migrate to v8

Nx Report

nx                 : 19.6.2
@nx/js             : 19.6.2
@nx/jest           : 19.6.2
@nx/linter         : 19.6.2
@nx/eslint         : 19.6.2
@nx/workspace      : 19.6.2
@nx/cypress        : 19.6.2
@nx/devkit         : 19.6.2
@nx/eslint-plugin  : 19.6.2
@nx/node           : 19.6.2
@nx/plugin         : 19.6.2
@nx/react          : 19.6.2
@nx/storybook      : 19.6.2
@nrwl/tao          : 19.6.2
@nx/vite           : 19.6.2
@nx/web            : 19.6.2
@nx/webpack        : 19.6.2
typescript         : 5.5.4
---------------------------------------
Community plugins:
nx-stylelint : 17.1.5

Failure Logs

🩺 The doctor is checking the health of your Storybook..
[Storybook doctor] ❌ Unable to find or evaluate libs/browser/storybook/.storybook/main.ts: SB_CORE-SERVER_0007 (MainFileEvaluationError): Storybook couldn't evaluate your libs/browser/storybook/.storybook/main.ts file.

Original error:
Error: Cannot find module '@nx/react/plugins/storybook/package.json'
Require stack:
- /libs/browser/storybook/.storybook/main.ts

Package Manager Version

No response

Operating System

Additional Information

No response

Coly010 commented 1 month ago

This is likely an issue on Storybook side.

Our migration for storybook 8 uses their automigrate feature.

ghost commented 1 month ago

@Coly010 should Storybook support the custom Nx plugins? Or you're saying they should simply improve the generator to check for those conditions instead of failing?

Coly010 commented 1 month ago

The latter. I need to investigate further to be sure, but once I am I can talk to the storybook team about it