Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d75d90f3
Unverified
Commit
d75d90f3
authored
Aug 11, 2025
by
Joseph
Committed by
GitHub
Aug 11, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: experimental config browserDebugInfoInTerminal (#82532)
Adding docs for `browserDebugInfoInTerminal`
parent
161a8ba0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
134 additions
and
0 deletions
+134
-0
browserDebugInfoInTerminal.mdx
...5-config/01-next-config-js/browserDebugInfoInTerminal.mdx
+134
-0
No files found.
docs/01-app/03-api-reference/05-config/01-next-config-js/browserDebugInfoInTerminal.mdx
0 → 100644
View file @
d75d90f3
---
title: browserDebugInfoInTerminal
description: Forward browser console logs and errors to your terminal during development.
version: experimental
---
The `experimental.browserDebugInfoInTerminal` option forwards console output and runtime errors originating in the browser to the dev server terminal.
This option is disabled by default. When enabled it only works in development mode.
## Usage
Enable forwarding:
```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
browserDebugInfoInTerminal: true,
},
}
export default nextConfig
```
```js filename="next.config.js" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
browserDebugInfoInTerminal: true,
},
}
module.exports = nextConfig
```
### Serialization limits
Deeply nested objects/arrays are truncated using **sensible defaults**. You can tweak these limits:
- **depthLimit**: (optional) Limit stringification depth for nested objects/arrays. Default: 5
- **edgeLimit**: (optional) Max number of properties or elements to include per object or array. Default: 100
```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
browserDebugInfoInTerminal: {
depthLimit: 5,
edgeLimit: 100,
},
},
}
export default nextConfig
```
```js filename="next.config.js" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
browserDebugInfoInTerminal: {
depthLimit: 5,
edgeLimit: 100,
},
},
}
module.exports = nextConfig
```
### Source location
Source locations are included by default when this feature is enabled.
```tsx filename="app/page.tsx" highlight={8}
'use client'
export default function Home() {
return (
<button
type="button"
onClick={() => {
console.log('Hello World')
}}
>
Click me
</button>
)
}
```
Clicking the button prints this message to the terminal.
```bash filename="Terminal"
[browser] Hello World (app/page.tsx:8:17)
```
To suppress them, set `showSourceLocation: false`.
- **showSourceLocation**: Include source location info when available.
```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
browserDebugInfoInTerminal: {
showSourceLocation: false,
},
},
}
export default nextConfig
```
```js filename="next.config.js" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
browserDebugInfoInTerminal: {
showSourceLocation: false,
},
},
}
module.exports = nextConfig
```
| Version | Changes |
| --------- | ---------------------------------------------------- |
| `v15.4.0` | experimental `browserDebugInfoInTerminal` introduced |
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment