nextjs - ✅(Solved) Fix TypeError: Converting circular structure to JSON after migration to Next 16 [1 pull requests, 16 comments, 8 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85244Fetched 2026-04-08 02:16:49
View on GitHub
Comments
16
Participants
8
Timeline
45
Reactions
7
Author
Timeline (top)
commented ×16subscribed ×12mentioned ×5referenced ×4

Error Message

The steps below create a new project that reproduce the error

  • got: error Converting circular structure to JSON This also turns out that this is a stacking error from ESLint. ESLint crash when trying to display the error:

Fix Action

Fix / Workaround

This can be fixed by create next 16 project and migrating the ESLint config.

PR fix notes

PR #85749: [codemod] fix: next-lint-to-eslint-cli did not handle 'next' plugin

Description (problem / solution / changelog)

Codemod next-lint-to-eslint-cli did not handle extends: ['next'] in legacy ESLint config.

x-ref: https://github.com/vercel/next.js/issues/85244#issuecomment-3482558412

Fixes #85244

Changed files

  • packages/next-codemod/transforms/__testfixtures__/next-lint-to-eslint-cli/legacy-config/.eslintrc.json (modified, +2/-0)
  • packages/next-codemod/transforms/__tests__/next-lint-to-eslint-cli.test.js (modified, +13/-3)
  • packages/next-codemod/transforms/next-lint-to-eslint-cli.ts (modified, +46/-8)

Code Example

/bin/sh: line 1: yarn: command not found
/bin/sh: line 1: pnpm: command not found

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Oct 12 16:31:16 UTC 2025
  Available memory (MB): 31506
  Available CPU cores: 20
Binaries:
  Node: 24.7.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.2
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/jcubic/10xDevs/tree/eslint

Sorry, this is not minimal reproduction but only relevant files are:

The steps below create a new project that reproduce the error

To Reproduce

  1. Create new Next 15 project (with ESLint + TypeScript)
  2. run npx @next/codemod@latest upgrade latest
  3. run npm install
  4. Run npm lint

Current vs. Expected behavior

  • expect: no errors.
  • got: error Converting circular structure to JSON

Provide environment information

/bin/sh: line 1: yarn: command not found
/bin/sh: line 1: pnpm: command not found

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Oct 12 16:31:16 UTC 2025
  Available memory (MB): 31506
  Available CPU cores: 20
Binaries:
  Node: 24.7.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Linting

Which stage(s) are affected? (Select all that apply)

npm run lint

Additional context

I'm not sure if this qualifies, but the codemod in documentation probably should update the ESLint file.

This can be fixed by create next 16 project and migrating the ESLint config.

This also turns out that this is a stacking error from ESLint. ESLint crash when trying to display the error:

If nothing can be done to fix the old setup, I would expect this information to be included in the migration instruction:

extent analysis

TL;DR

Create a new Next 16 project and migrate the ESLint configuration to resolve the "Converting circular structure to JSON" error.

Guidance

  • The error is likely caused by an incompatibility between the current ESLint configuration and the upgraded Next.js version.
  • To verify, try running npm lint with a minimal ESLint configuration to see if the error persists.
  • As a workaround, create a new Next 16 project and migrate the existing code to the new project, updating the ESLint configuration accordingly.
  • Consider updating the migration instructions to include information about potential ESLint configuration issues.

Example

No code snippet is provided as the issue is related to configuration and project setup.

Notes

The provided information suggests that the issue is specific to the ESLint configuration and the upgraded Next.js version. The solution may not apply to other versions or configurations.

Recommendation

Apply workaround: Create a new Next 16 project and migrate the ESLint configuration. This approach is recommended as it allows for a clean setup and avoids potential compatibility issues with the existing configuration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix TypeError: Converting circular structure to JSON after migration to Next 16 [1 pull requests, 16 comments, 8 participants]