Closed IanVS closed 1 year ago
Hi!
It's missing to update the dependency @vitejs/plugin-react to v3.0 or higher. Current version is using vite 3.
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer vite@"^3.0.0" from @vitejs/plugin-react@2.2.0
npm WARN node_modules/@vitejs/plugin-react
npm WARN @vitejs/plugin-react@"^2.0.0" from @storybook/builder-vite@0.3.0
npm WARN node_modules/@storybook/builder-vite
npm WARN
npm WARN Conflicting peer dependency: vite@3.2.5
npm WARN node_modules/vite
npm WARN peer vite@"^3.0.0" from @vitejs/plugin-react@2.2.0
npm WARN node_modules/@vitejs/plugin-react
npm WARN @vitejs/plugin-react@"^2.0.0" from @storybook/builder-vite@0.3.0
npm WARN node_modules/@storybook/builder-vite
Hi @sfe-efficy, this was a breaking change that requires Vite 4. If you are using Vite 3, you'll need to install @storybook/builder-vite@0.2.x
.
I opened an issue, I guess it's better https://github.com/storybookjs/builder-vite/issues/547
Fixes https://github.com/storybookjs/builder-vite/issues/526
This updates the peer dependencies for vite and vite plugins, and also updates
@joshwooding/vite-plugin-react-docgen-typescript
to a version that makes TypeScript an optional dependency, to avoid peer dependency warnings for non-typescript projects.Finally, I added a bit of a script to run
yarn install
in each of the example projects because I got really tired of doing that manually. ;)FWIW, this will require a bump of this project to 0.3.0 when released. We did something similar for 0.1 to 0.2, without much trouble.