flags declares @sveltejs/kit as an optionalDependencies/peerOptional dependency. In npm, this pulls in the peer chain:
flags@4.2.1
└── @sveltejs/kit@2.70.1
└── @sveltejs/vite-plugin-svelte@7.2.0
└── peer vite@"^8.0.0-beta.7 || ^8.0.0"
This causes npm install to fail with an ERESOLVE error for any project that already depends on Vite 7 (e.g. through Vitest, Storybook, Vite plugin tooling, etc.):
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: shop-next@0.0.0
npm error Found: flags@4.2.0
npm error node_modules/flags
npm error flags@"^4.2.1" from the root project
npm error
npm error Could not resolve dependency:
npm error flags@"^4.2.1" from the root project
npm error
npm error Conflicting peer dependency: vite@8.1.5
npm error node_modules/vite
npm error peer vite@"^8.0.0-beta.7 || ^8.0.0" from @sveltejs/vite-plugin-svelte@7.2.0
npm error node_modules/@sveltejs/vite-plugin-svelte
npm error peer @sveltejs/vite-plugin-svelte@"^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0" from @sveltejs/kit@2.70.1
npm error node_modules/@sveltejs/kit
npm error peerOptional @sveltejs/kit@"*" from flags@4.2.1
npm error node_modules/flags
npm error flags@"^4.2.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
For now I do a npm install --force, but it's annoying having to do this each time we update flags.
We use vitest ^3.2.4 and a few other packages that bring in Vite 7:
➜ npm ls vite
shop-next@0.0.0 /Users/wolsph/Projects/shop-next
├─┬ @storybook/addon-docs@10.4.6
│ └─┬ @storybook/csf-plugin@10.4.6
│ └── vite@7.3.2 deduped
├─┬ @vercel/toolbar@0.2.6
│ ├─┬ @vercel/microfrontends@2.3.2
│ │ └── vite@7.3.2 deduped
│ └── vite@7.3.2
├─┬ @vitejs/plugin-react@4.7.0
│ └── vite@7.3.2 deduped
├─┬ vitest-fail-on-console@0.10.1
│ └── vite@7.3.2 deduped
└─┬ vitest@3.2.4
├─┬ @vitest/mocker@3.2.4
│ └── vite@7.3.2 deduped
├─┬ vite-node@3.2.4
│ └── vite@7.3.2 deduped
└── vite@7.3.2 deduped
flagsdeclares@sveltejs/kitas an optionalDependencies/peerOptional dependency. In npm, this pulls in the peer chain:This causes
npm installto fail with anERESOLVEerror for any project that already depends on Vite 7 (e.g. through Vitest, Storybook, Vite plugin tooling, etc.):For now I do a
npm install --force, but it's annoying having to do this each time we updateflags.We use
vitest^3.2.4and a few other packages that bring in Vite 7: