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

Storybook Resolution Errors #4

Open
mori-tt opened this issue Oct 24, 2024 · 6 comments
Open

Storybook Resolution Errors #4

mori-tt opened this issue Oct 24, 2024 · 6 comments

Comments

@mori-tt
Copy link

mori-tt commented Oct 24, 2024

Description

When trying to run Storybook in the sns-shared-ui package of our monorepo project, I'm encountering multiple resolution errors. It seems that several Storybook addons are not being recognized as dependencies.

Steps to Reproduce

  1. Navigate to the sns-shared-ui package
  2. Run npm install
  3. Run npm run storybook

Error Message

✘ [ERROR] Could not resolve "@storybook/addon-viewport/manager"
✘ [ERROR] Could not resolve "@storybook/addon-toolbars/manager"
✘ [ERROR] Could not resolve "@storybook/addon-backgrounds/manager"
✘ [ERROR] Could not resolve "@storybook/addon-actions/manager"
✘ [ERROR] Could not resolve "@storybook/addon-controls/manager"
✘ [ERROR] Could not resolve "@storybook/addon-measure/manager"
✘ [ERROR] Could not resolve "@storybook/addon-outline/manager"
✘ [ERROR] Could not resolve "@storybook/instrumenter"
✘ [ERROR] Could not resolve "@storybook/global"
✘ [ERROR] Could not resolve "polished"
✘ [ERROR] Could not resolve "react-confetti"

The error message suggests that these packages are not listed as dependencies in the package.json file.

Environment

  • Node.js version: 21.3.0
  • npm version: 10.8.2
  • Storybook version: 7.5.1
  • Operating System: Mac OS(M2)

package.json

json:packages/sns-shared-ui/package.json

Additional Context

This is occurring in a monorepo setup using Yarn PnP. The error messages suggest that the Yarn Plug'n'Play manifest is forbidding the import of these packages because they're not listed as dependencies.

Possible Solution

It seems that we might need to explicitly add these Storybook addons as dependencies in the package.json file of the sns-shared-ui package. Alternatively, we might need to adjust our Yarn PnP configuration to allow these imports.

Any help or guidance on resolving these dependency issues would be greatly appreciated.

@takefumi-yoshii
Copy link
Member

I arranged same Environment and try it but not caused same trouble. I think this problem depends on your "Additional Context".

How to resolve those problem is out of support this book because it was written only using npm workspace. If I will provide some solution for you, I have to answer how to resolve all of inquiries to keep fair.

Therefore, If you want to use something other composition, it's just your responsibility how to resolve it. I appreciate your understanding and cooperation. Thanks

@mori-tt
Copy link
Author

mori-tt commented Oct 25, 2024 via email

@takefumi-yoshii
Copy link
Member

リポジトリクローン後、npm iで node_modules をインストールする前提で記述しています。ご報告いただいたい状況ですと、yarn を使用されていますので、そこを見直していただければ幸いです。

@mori-tt
Copy link
Author

mori-tt commented Oct 25, 2024 via email

@takefumi-yoshii
Copy link
Member

私も再度リポジトリをクローンし、npm iでインストールしなおして試しましたが、再現ができません。。
数名の同僚と輪読会で検証した経験もあるのですが、今回ご報告いただいている事象は初見です。
お力になれずすみません。

@mori-tt
Copy link
Author

mori-tt commented Oct 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants