Skip to content

Prebuild error when using pnpm #219

@CryogenicPlanet

Description

@CryogenicPlanet

Describe the bug
I am using pnpm on a nextjs repository and followed the steps here https://answers.netlify.com/t/using-pnpm-and-pnpm-workspaces/2759 and netlify/build#1633 (comment) this was working fine with next-on-netlify

However now with this 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.

Also, this might be better categorized as a feature request, not entirely sure which it falls under exactly

image

To Reproduce

Steps to reproduce the behaviour:

  1. Create a next project with pnpm and the below netlify.toml
  2. Push to netlify and build without cache. (I think it worked the first few times for me because it has next cached from yarn before, we just migrated over)
  3. Should see the error in the console

This repo can be used to reproduce the bug https://github.com/CryogenicPlanet/netlify-next-prebuild-bug

Expected behaviour
A workaround or suggestion to use pnpm with this new plugin would be great or a way to disable the plugins prebuild

Versions

  • Next.js: latest
  • plugin (if installed at fixed version): 3.1.0

If you're using file-based installation

// netlify.toml
[build]
  command   = "npm run build"
  publish   = "out"
[build.environment]
  NPM_FLAGS="--prefix=/dev/null"  
[[plugins]]
  package = "@netlify/plugin-nextjs"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions