I am having trouble using
nextjs on netlify. I followed the recommendations here Using pnpm and pnpm workspaces and Feature request: Add PNPM support · Issue #1633 · netlify/build · GitHub which were initially working fine with
next-on-netlify. Now even that seems to be breaking.
With the next build plugin, I run into an error that says
next is not installed on the prebuild by the plugin, which runs before my custom prebuild which installs the packages.
Steps to reproduce the behaviour:
- Create a
pnpmand the below
- Push to netlify and build without cache. (I think it worked the first few times for me because it has next cached from
yarnbefore, we just migrated over)
- Should see the error in the console
This repo can be used to reproduce the bug GitHub - CryogenicPlanet/netlify-next-prebuild-bug
// netlify.toml [build] command = "npm run build" publish = "out" [build.environment] NPM_FLAGS="--prefix=/dev/null" [[plugins]] package = "@netlify/plugin-nextjs"
Kind of blocked on this bug because netlify is not able to build our codebase and don’t want to move back to
yarn as it is occupying way too much space.
I posted this same bug on github too Prebuild error when using pnpm · Issue #219 · netlify/netlify-plugin-nextjs · GitHub would love any recommendations to work around this