saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.98k stars 229 forks source link

Monorepo: "Next not found in both dependencies and devDependencies." #476

Open nandorojo opened 4 months ago

nandorojo commented 4 months ago

Getting this error when I build in prod:

[nextron] Next not found in both dependencies and devDependencies.

It's due to this code:

https://github.com/saltyshiomix/nextron/blob/6907722b6cd072fda2b09d4ed1aadb58823486e6/lib/configs/useExportCommand.ts#L26-L32

next is getting pulled from a root monorepo. The solution would be to add this line:

require('next/package.json').version

This way it evaluates the package correctly.