storybook icon indicating copy to clipboard operation
storybook copied to clipboard

The symbol "prevRefreshReg" has already been declared

Open philipp-winterle opened this issue 1 year ago • 2 comments

Describe the bug In the new 7.0 Alpha 35 it seems to break vite-plugin-react while launching storybook with storybook dev.

ERROR: The symbol "prevRefreshReg" has already been declared

Does not happen in Alpha 34.

System

Environment Info:

  System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.8.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 103.0.2
    Safari: 16.0
  npmPackages:
    @storybook/addon-essentials: 7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/addon-links: 7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/addons: ^7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/cli: 7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/react: 7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/react-vite: ^7.0.0-alpha.34 => 7.0.0-alpha.34
    @storybook/theming: ^7.0.0-alpha.34 => 7.0.0-alpha.34

philipp-winterle avatar Oct 05 '22 17:10 philipp-winterle

Ok I figured out that this only happens after updating the react-vite package to alpha 35.

It is working with this setup

    "@storybook/addon-essentials": "7.0.0-alpha.35",
    "@storybook/addon-links": "7.0.0-alpha.35",
    "@storybook/addons": "7.0.0-alpha.35",
    "@storybook/cli": "7.0.0-alpha.35",
    "@storybook/react": "7.0.0-alpha.35",
    "@storybook/react-vite": "7.0.0-alpha.34",
    "@storybook/theming": "7.0.0-alpha.35",

and NOT working with this

    "@storybook/addon-essentials": "7.0.0-alpha.35",
    "@storybook/addon-links": "7.0.0-alpha.35",
    "@storybook/addons": "7.0.0-alpha.35",
    "@storybook/cli": "7.0.0-alpha.35",
    "@storybook/react": "7.0.0-alpha.35",
    "@storybook/react-vite": "7.0.0-alpha.35",
    "@storybook/theming": "7.0.0-alpha.35",

philipp-winterle avatar Oct 10 '22 12:10 philipp-winterle

Same here,

I see a log output below:

[@vitejs/plugin-react] You should stop using "vite:react-jsx" since this plugin conflicts with it.

UPDATE:

@hummal If you are doing mergeConfig with your local vite.config.js in .storybook/main.cjs#viteFinal, you may not need it.

ka2n avatar Oct 14 '22 12:10 ka2n

@ka2n thx for your input. It is true. Without plugin-react it is working. Also with alpha 38.

Thank you for your good input!

philipp-winterle avatar Oct 17 '22 11:10 philipp-winterle