Skip to content

[Bug]: Next.js 12.0.7 using pnpm returns: Could not find Next.js server #992

@zaiste

Description

@zaiste

Steps to reproduce

  1. Clone the provided repository
  2. In the Netlify UI, set the Publish directory to .next
  3. In the Netlify UI, set the Build command to npx pnpm install --store=node_modules/.pnpm-store && npx pnpm build

A link to a reproduction repository

https://github.com/saleor/react-storefront

Plugin version

4.0.0

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

No response

Your netlify.toml file

`netlify.toml`
# Paste content of your `netlify.toml` file here

Relevant log output (or link to your logs)

Live demo

Build logs
{
  "errorType": "Error",
  "errorMessage": "Could not find Next.js server",
  "trace": [
    "Error: Could not find Next.js server",
    "    at getNextServer (/var/task/.netlify/functions-internal/___netlify-handler/handlerUtils.js:157:19)",
    "    at /var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:31:24",
    "    at Object.<anonymous> (/var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:91:3)",
    "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
    "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
    "    at Module.load (internal/modules/cjs/loader.js:950:32)",
    "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
    "    at Module.require (internal/modules/cjs/loader.js:974:19)",
    "    at require (internal/modules/cjs/helpers.js:93:18)",
    "    at Object.<anonymous> (/var/task/___netlify-handler.js:1:18)"
  ]
}

Metadata

Metadata

Assignees

Labels

type: bugcode to address defects in shipped code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions