question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Netlify deploy fails with Could not resolve dependency: peer vite@">=3.0.0-alpha || >= 3.0.0" from @storybook/builder-vite@0.2.0

See original GitHub issue

What version of vite are you using?

vite@2.9.14

System info and storybook versions

This is from my local machine and does not match Netlify where the build is failing (running npm run build locally works fine):

Environment Info:

System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.17 - ~/.yarn/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Browsers: Chrome: 103.0.5060.114 Safari: 15.5 npmPackages: @storybook/addon-actions: ^6.5.9 => 6.5.9 @storybook/addon-essentials: ^6.5.9 => 6.5.9 @storybook/addon-interactions: ^6.5.9 => 6.5.9 @storybook/addon-links: ^6.5.9 => 6.5.9 @storybook/builder-vite: ^0.2.0 => 0.1.39 @storybook/testing-library: ^0.0.13 => 0.0.13 @storybook/vue3: ^6.5.9 => 6.5.9

Describe the Bug

When a build is triggered on Netlify, the following errors are shown in the build log and the build fails:

Installing NPM modules using NPM version 8.11.0
9:12:31 PM: npm ERR! code ERESOLVE
9:12:31 PM: npm ERR! ERESOLVE could not resolve
9:12:31 PM: npm ERR!
9:12:31 PM: Creating deploy upload records
9:12:31 PM: npm ERR! While resolving: @storybook/builder-vite@0.2.0
9:12:31 PM: npm ERR! Found: vite@2.9.14
9:12:31 PM: npm ERR! node_modules/vite
9:12:31 PM: npm ERR!   dev vite@"^2.9.14" from the root project
9:12:31 PM: npm ERR!   peer vite@">2.0.0-0" from @joshwooding/vite-plugin-react-docgen-typescript@0.0.4
9:12:31 PM: npm ERR!   node_modules/@joshwooding/vite-plugin-react-docgen-typescript
9:12:32 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
9:12:31 PM: npm ERR!     @joshwooding/vite-plugin-react-docgen-typescript@"0.0.4" from @storybook/builder-vite@0.2.0
9:12:31 PM: npm ERR!     node_modules/@storybook/builder-vite
9:12:31 PM: npm ERR!       dev @storybook/builder-vite@"^0.2.0" from the root project
9:12:31 PM: npm ERR!   2 more (@vitejs/plugin-vue, vite-plugin-pwa)
9:12:31 PM: npm ERR!
9:12:31 PM: npm ERR! Could not resolve dependency:
9:12:31 PM: npm ERR! peer vite@">=3.0.0-alpha || >= 3.0.0" from @storybook/builder-vite@0.2.0
9:12:31 PM: npm ERR! node_modules/@storybook/builder-vite
9:12:31 PM: npm ERR!   dev @storybook/builder-vite@"^0.2.0" from the root project
9:12:31 PM: npm ERR!
9:12:31 PM: npm ERR! Conflicting peer dependency: vite@3.0.0
9:12:31 PM: npm ERR! node_modules/vite
9:12:31 PM: npm ERR!   peer vite@">=3.0.0-alpha || >= 3.0.0" from @storybook/builder-vite@0.2.0
9:12:31 PM: npm ERR!   node_modules/@storybook/builder-vite
9:12:31 PM: npm ERR!     dev @storybook/builder-vite@"^0.2.0" from the root project
9:12:31 PM: npm ERR!
9:12:31 PM: npm ERR! Fix the upstream dependency conflict, or retry
9:12:31 PM: npm ERR! this command with --force, or --legacy-peer-deps
9:12:31 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
schalkneethlingcommented, Jul 17, 2022

I will pin this to the earlier version until I can figure out what is preventing vite and @vitejs/plugin-vue from upgrading. Thanks.

0reactions
IanVScommented, Jul 17, 2022

0.2.0 requires vite 3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am facing build error while deploying the project - Support
The error is a peer dependency conflict relating to versions of react, which provides guidance on how you can attempt to resolve it:...
Read more >
Site deploy fail - Netlify Support Forums
When deploy using Git with dist/ and a npm run build settings, it gives “site deploy failed” and shows shows this deploy log...
Read more >
Build failed on Netlify but it works on local - Support
On June 1, I deployed without problem like always and on June 3, I deployed again with minor changes and got this error....
Read more >
Deploy failed to Publish website - Netlify Support Forums
The error is a peer dependency conflict relating to versions of react, which provides guidance on how you can attempt to resolve it:...
Read more >
Build troubleshooting tips - Netlify Docs
1, you may find Could not resolve dependency or Conflicting peer dependency warnings in your Netlify deploy log that ultimately result in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found