You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/01-app/03-building-your-application/07-configuring/16-debugging.mdx
+1-9
Original file line number
Diff line number
Diff line change
@@ -151,15 +151,7 @@ Debugging server-side code works similarly to client-side debugging. When search
151
151
152
152
When you encounter an error, inspecting the source code can help trace the root cause of errors.
153
153
154
-
Next.js will display a Node.js logo like a green button on the dev overlay. By clicking that button, the DevTools URL is copied to your clipboard. You can open a new browser tab with that URL to inspect the Next.js server process.
Next.js will display a Node.js icon underneath the Next.js version indicator on the error overlay. By clicking that icon, the DevTools URL is copied to your clipboard. You can open a new browser tab with that URL to inspect the Next.js server process.
description: Optimized pages include an indicator to let you know if it's being statically optimized. You can opt-out of it here.
3
+
description: Configuration options for the on-screen indicator that gives context about the current route you're viewing during development.
4
4
---
5
5
6
-
{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
7
-
8
-
<AppOnly>
9
-
10
-
`devIndicators` allows you to configure the on-screen indicators that give context about the current route you're viewing during development.
6
+
`devIndicators` allows you to configure the on-screen indicator that gives context about the current route you're viewing during development.
11
7
12
8
```ts filename="Types"
13
-
devIndicators: {
14
-
buildActivityPosition?:'bottom-right'
9
+
devIndicators: false|{
10
+
position?:'bottom-right'
15
11
|'bottom-left'
16
12
|'top-right'
17
-
|'top-left', // defaults to 'bottom-right'
13
+
|'top-left', // defaults to 'bottom-left',
18
14
},
19
15
```
20
16
17
+
Setting `devIndicators` to `false` will hide the indicator, however Next.js will continue to surface any build or runtime errors that were encountered.
18
+
21
19
## Troubleshooting
22
20
23
-
### Static route not showing the indicator
21
+
### Indicator not marking a route as static
24
22
25
-
If you expect a route to be static and the indicator is enabled but not showing, it's likely the route has opted out of static rendering.
23
+
If you expect a route to be static and the indicator has marked it as dynamic, it's likely the route has opted out of static rendering.
26
24
27
25
You can confirm if a route is [static](/docs/app/building-your-application/rendering/server-components#static-rendering-default) or [dynamic](/docs/app/building-your-application/rendering/server-components#dynamic-rendering) by building your application using `next build --debug`, and checking the output in your terminal. Static (or prerendered) routes will display a `○` symbol, whereas dynamic routes will display a `ƒ` symbol. For example:
28
26
@@ -35,6 +33,8 @@ Route (app) Size First Load JS
35
33
ƒ (Dynamic) server-rendered on demand
36
34
```
37
35
36
+
<AppOnly>
37
+
38
38
There are two reasons a route might opt out of static rendering:
39
39
40
40
- The presence of [Dynamic APIs](/docs/app/building-your-application/rendering/server-components#dynamic-apis) which rely on runtime information.
@@ -46,20 +46,6 @@ Check your route for any of these conditions, and if you are not able to statica
46
46
47
47
<PagesOnly>
48
48
49
-
> **Good to know**: This indicator was removed in Next.js version 10.0.1. We recommend upgrading to the latest version of Next.js.
50
-
51
-
When a page qualifies for [Automatic Static Optimization](/docs/pages/building-your-application/rendering/automatic-static-optimization) we show an indicator to let you know.
52
-
53
-
This is helpful since automatic static optimization can be very beneficial and knowing immediately in development if the page qualifies can be useful.
54
-
55
-
In some cases this indicator might not be useful, like when working on electron applications. To remove it open `next.config.js` and disable the `autoPrerender` config in `devIndicators`:
56
-
57
-
```js filename="next.config.js"
58
-
module.exports= {
59
-
devIndicators: {
60
-
autoPrerender:false,
61
-
},
62
-
}
63
-
```
49
+
When exporting [`getServerSideProps`](/docs/pages/building-your-application/data-fetching/get-server-side-props) or [`getInitialProps`](/docs/pages/api-reference/functions/get-initial-props) from a page, it will be marked as dynamic.
Copy file name to clipboardExpand all lines: packages/next/src/client/components/react-dev-overlay/ui/components/errors/error-overlay-toolbar/error-overlay-toolbar.tsx
0 commit comments