histoire-dev / histoire-dev/histoire
Warning on vite peer dependency with yarn 3
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
I have some warnings when I added histoire with yarn 3.4.1
```
➤ YN0002: │ @histoire/app@npm:0.15.8 doesn't provide vite (p45e27), requested by @histoire/shared
➤ YN0002: │ @histoire/controls@npm:0.15.8 doesn't provide vite (p1442d), requested by @histoire/shared
```
I resolved the warnings with this lines in my `.yarnrc.yml`:
```yaml
packageExtensions:
"@histoire/app@*":
peerDependencies:
vite: "*"
"@histoire/plugin-vue@*":
peerDependencies:
vite: "*"
"@histoire/controls@*":
peerDependencies:
vite: "*"
```
Maybe, the solution is to add `vite` as `peerDependencies` for @histoire/app, @histoire/controls, @histoire/plugin-vue...
### Reproduction
```
$ mkdir test
$ cd test
$ yarn init -2
...
$ yarn add --dev vite histoire
...
$ yarn install
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @histoire/app@npm:0.15.8 doesn't provide vite (p45e27), requested by @histoire/shared
➤ YN0002: │ @histoire/controls@npm:0.15.8 doesn't provide vite (p1442d), requested by @histoire/shared
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 149ms
```
### System Info
```shell
System:
OS: macOS 13.1
CPU: (10) arm64 Apple M1 Max
Memory: 7.79 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.6.1 - /opt/homebrew/bin/node
Yarn: 3.4.1 - /opt/homebrew/bin/yarn
npm: 9.4.0 - /opt/homebrew/bin/npm
Browsers:
Firefox Developer Edition: 111.0
Safari: 16.2
```
### Used Package Manager
yarn
### Validations
- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Start by reproducing the warning with Yarn 3.4.1 using the commands in the issue, then inspect the peerDependencies for @histoire/app, @histoire/controls, and @histoire/plugin-vue. Done means the minimal project can install histoire and vite without the reported missing-vite peer dependency warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vite
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100