storybook
storybook copied to clipboard
The symbol "prevRefreshReg" has already been declared
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
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",
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 thx for your input. It is true. Without plugin-react it is working. Also with alpha 38.
Thank you for your good input!