Next.js Discord

Discord Forum

Cypress wanted Next as a dev dependency and then pnpm removed it from dependency list

Answered
Beauceron posted this in #help-forum
Open in Discord
BeauceronOP
Hi there, I'm just now starting to setup cypress testing for my next project. I'm following their guide on component testing and it asked me to do
pnpm i next -D
and as such next was added as a dev dependency and removed as a normal dependency. My question really just is, will I need to have Next as a normal dependency as well? Will something break if it's only a dev dependency? Should it be both a dependency and a dev dependency or?

The reason I'm confused is that to my knowledge, dev dependency are all the things that are not used in the production build. But it would make sense to me that next is not a dev dependant dependency. Cypress component testing needs it for all the stuff that it's doing that isn't needed for the production build, so it makes sense that it would want it as a dev dependency.

So, all in all I'm just a little confused and seeking a little bit of knowledge on the matter.
Answered by joulev
No, when building a next app, devDeps or deps are no different
View full answer

4 Replies