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
Backports #78184 (@timneutkens)
User request:
(https://vercel.slack.com/archives/C06CUNEC64D/p1750069211569019)
> could the change from `next internal turbo-trace-server` to `next
internal trace` be backported to a non-canary Next.js version? (to align
with the published docs suggestion)
>
> currently, the docs say "You can interpret the file using `next
internal trace [path-to-file]`:" ... and then further down "On versions
where `trace` is not available, the command was named
`turbo-trace-server`" ... which means that anyone on non-canary versions
following the docs right now will receive `error: unknown command
'trace'`
>
> https://nextjs.org/docs/app/guides/local-development#turbopack-tracing
The `mdx` change here isn't really relevant, since we don't build docs
from this branch, but it merges cleanly, so it's harmless.
Co-authored-by: Tim Neutkens <[email protected]>
Copy file name to clipboardExpand all lines: docs/01-app/03-building-your-application/06-optimizing/14-local-development.mdx
+29-6Lines changed: 29 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,8 @@ module.exports = {
78
78
}
79
79
```
80
80
81
+
Turbopack automatically analyzes imports and optimizes them. It does not require this configuration.
82
+
81
83
### 4. Check your Tailwind CSS setup
82
84
83
85
If you're using Tailwind CSS, make sure it's set up correctly.
@@ -140,15 +142,36 @@ Use this command to see more detailed information about what's happening during
140
142
next dev --verbose
141
143
```
142
144
143
-
## Still having problems?
145
+
## Turbopack tracing
144
146
145
-
If you've tried everything and still have issues:
147
+
Turbopack tracing is a tool that helps you understand the performance of your application during local development.
148
+
It provides detailed information about the time taken for each module to compile and how they are related.
146
149
147
-
1.Create a simple version of your app that shows the problem.
148
-
2. Generate a special file that shows what's happening:
150
+
1.Make sure you have the latest version of Next.js installed.
151
+
1. Generate a Turbopack trace file:
149
152
150
153
```bash
151
-
NEXT_CPU_PROF=1 npm run dev
154
+
NEXT_TURBOPACK_TRACING=1 npm run dev
152
155
```
153
156
154
-
3. Share this file (found in your project's main folder) and the `.next/trace` file on GitHub as a new issue.
157
+
1. Navigate around your application or make edits to files to reproduce the problem.
158
+
1. Stop the Next.js development server.
159
+
1. A file called `trace-turbopack` will be available in the `.next` folder.
160
+
1. You can interpret the file using `next internal trace [path-to-file]`:
161
+
162
+
```bash
163
+
next internal trace .next/trace-turbopack
164
+
```
165
+
166
+
On versions where `trace` is not available, the command was named `turbo-trace-server`:
167
+
168
+
```bash
169
+
next internal turbo-trace-server .next/trace-turbopack
170
+
```
171
+
172
+
1. Once the trace server is running you can view the trace at https://trace.nextjs.org/.
173
+
1. By default the trace viewer will aggregate timings, in order to see each individual time you can switch from "Aggregated in order" to "Spans in order" at the top right of the viewer.
174
+
175
+
## Still having problems?
176
+
177
+
Share the trace file generated in the [Turbopack Tracing](#turbopack-tracing) section and share it on [GitHub Discussions](https://github.com/vercel/next.js/discussions) or [Discord](https://nextjs.org/discord).
0 commit comments