Skip to content

next build cause inconsistent graph issues in version upgrade to 22.3.1 #33988

@TalMikey

Description

@TalMikey

Current Behavior

We upgraded from 21.4.0 to 22.3.1.
We use Vercel to deploy our Next.js UI.
We are getting errors inconsistently as follows:
> nx run web:build:production ▲ Next.js 16.0.10 (Turbopack) - Experiments (use with caution): · optimizePackageImports Creating an optimized production build ... > Build error occurred Error: Could not create project graph. Please ensure that your workspace is valid. at ignore-listed frames Build process exited due to code 1

This reproduces with next build or with the executor @nx/next:build.

Expected Behavior

Build passes without graph failures.

GitHub Repo

No response

Steps to Reproduce

  1. Use NX 22.3.1.
  2. Create a Next.js app and build it using @nx/next:build executor.
  3. Run build multiple times.

Nx Report

NX   Report complete - copy this into the issue template
Node           : 20.19.6
OS             : linux-x64
Native Target  : x86_64-linux
pnpm           : 10.12.1
nx                     : 22.3.1
@nx/js                 : 22.3.1
@nx/eslint             : 22.3.1
@nx/workspace          : 22.3.1
@nx/jest               : 22.3.1
@nx/cypress            : 22.3.1
@nx/devkit             : 22.3.1
@nx/esbuild            : 22.3.1
@nx/eslint-plugin      : 22.3.1
@nx/module-federation  : 22.3.1
@nx/nest               : 22.3.1
@nx/next               : 22.3.1
@nx/node               : 22.3.1
@nx/playwright         : 22.3.1
@nx/plugin             : 22.3.1
@nx/react              : 22.3.1
@nx/rollup             : 22.3.1
@nx/storybook          : 22.3.1
@nx/vite               : 22.3.1
@nx/vitest             : 22.3.1
@nx/web                : 22.3.1
@nx/webpack            : 22.3.1
@nx/docker             : 22.3.1
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/next/plugin
@nx/playwright/plugin
@nx/storybook/plugin
@nx/vite/plugin
@nx/js/typescript
---------------------------------------
Community plugins:
@nx-tools/nx-prisma : 7.0.2
---------------------------------------
Local workspace plugins:
@terra/workspace
---------------------------------------
Cache Usage: 131.53 KB / 7.16 GB

Failure Logs

Package Manager Version

pnpm 10.12.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions