Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuild error when using pnpm #219

Closed
CryogenicPlanet opened this issue Apr 12, 2021 · 2 comments
Closed

Prebuild error when using pnpm #219

CryogenicPlanet opened this issue Apr 12, 2021 · 2 comments
Labels
priority: low type: bug code to address defects in shipped code

Comments

@CryogenicPlanet
Copy link

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"
@mcmxcdev
Copy link

mcmxcdev commented Sep 6, 2021

Encountering the same issue. Please prioritize this higher as it is a major blocker when using pnpm with next.

@ascorbic
Copy link
Contributor

With the new plugin version you can use the workaround, though with one change: instead of --prefix=/dev/null, pass --version as the flag. Of course native pnpm support would be best, but this is the best solution for now

serhalp pushed a commit that referenced this issue Apr 5, 2024
* chore: add middleware-src fixture

* fix: ensure relative import for edge-runtime-webpack file

* chore: test middleware in src dir

* fix: middleware function name

* fix: middleware bundle resolution for non-src builds

* chore: fix function name in test

* fix: middleware bundle import separator

* chore: move turborepo fixture into src and add middleware

* chore: update turborepo test to check for middleware headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

4 participants