Skip to content

Netlify NextJS builds are broken in 3.7.0 when using multiple npm commands #528

@andismith

Description

@andismith

Describe the bug
A bug has been introduced with version 3.7.0 where if the netlify.toml configuration file contains multiple npm commands such as npm run build && npm run export, the plugin fails with an internal error.

image

image

To Reproduce
Steps to reproduce the behavior:

  1. Fork https://github.com/andismith/nextjs-test-blog (this is a copy of the Netlify NextJS starter blog, with an adjusted netlify.toml file).
  2. Build it on Netlify
  3. See error
  4. Run npm install @netlify/[email protected] --save-dev
  5. See it now passes

Example at: https://app.netlify.com/sites/elated-mcclintock-cdc73c/deploys

Expected behavior
The build should still work in v3.7.0

Versions

  • Next.js: 11
  • @netlify/plugin-nextjs: 3.7.0

If you're using file-based installation

  • netlify.toml:
[build]
  publish = "dist"
  command = "npm run build && npm run export"

(this also occurs for multiple yarn commands too)

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