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

[Bug]: Storybook injecting packageManager pnpm 8.1.0 when you run npm run storybook #29146

Closed
stevensacks opened this issue Sep 18, 2024 · 1 comment · Fixed by #29152
Closed
Assignees

Comments

@stevensacks
Copy link
Contributor

Describe the bug

When you run npm run storybook on a vite project, it is injecting this into the package.json every single time:

"packageManager": "[email protected]+sha1.09ebf306075e96037432071992bb00340c263d85"
  1. This breaks the Chromatic Github Action.
  2. If I want to use pnpm, I will. Don't force it on me.
  3. Version 8.1.0 is bugged with Node 20. You have to use 8.3.1 minimum or pnpm can't install libraries.

Reproduction link

https://storybook.js.org/

Reproduction steps

As stated in the description. Make a vite project and npm run storybook and it will inject that line into package.json every time.

Delete the line from package.json, npm run storybook, and it's back again.

System

Storybook Environment Info:

  System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M2 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.3 - ~/.nvm/versions/node/v20.17.0/bin/npm <----- active
    pnpm: 8.1.0 - ~/.nvm/versions/node/v20.17.0/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.139
    Safari: 17.6
  npmPackages:
    @storybook/addon-essentials: 8.3.1 => 8.3.1 
    @storybook/addon-interactions: 8.3.1 => 8.3.1 
    @storybook/addon-links: 8.3.1 => 8.3.1 
    @storybook/blocks: 8.3.1 => 8.3.1 
    @storybook/manager-api: 8.3.1 => 8.3.1 
    @storybook/preview-api: 8.3.1 => 8.3.1 
    @storybook/react: 8.3.1 => 8.3.1 
    @storybook/react-vite: 8.3.1 => 8.3.1 
    @storybook/test: 8.3.1 => 8.3.1 
    @storybook/theming: 8.3.1 => 8.3.1 
    @storybook/types: 8.3.1 => 8.3.1 
    chromatic: 11.10.2 => 11.10.2 
    eslint-plugin-storybook: 0.8.0 => 0.8.0 
    storybook: 8.3.1 => 8.3.1 
    storybook-dark-mode: 4.0.2 => 4.0.2 
    storybook-react-i18next: 3.1.7 => 3.1.7

Additional context

No response

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Sep 19, 2024

Thank you for reporting this bug!

If I want to use pnpm, I will. Don't force it on me.

As you might guess, we do not intend to force anyone to use a specific package manager. This is clearly a bug.

This bug occurs as soon as you have corepack enabled. We run pnpm --version in a try/catch block to determine whether the user has pnpm installed. It seems that corepack will automatically add a packageManager field as soon as it is unavailable or update it if it is outdated.

Working on a fix right now..

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

Successfully merging a pull request may close this issue.

2 participants