To collect a trace file for Turbopack build performance auditing, follow these steps:
NEXT_TURBOPACK_TRACING=1 npm run dev
Or if you're using yarn:
NEXT_TURBOPACK_TRACING=1 yarn dev
trace-turbopack
will be generated in the .next
folder 3To analyze the trace file:
next internal trace .next/trace-turbopack
On older versions of Next.js, you might need to use:
next internal turbo-trace-server .next/trace-turbopack
The trace file contains valuable information without including your application code 2:
This advanced tracing gives the Next.js team all the information needed to investigate slowdowns and memory usage deeply 2.
When reporting issues related to Turbopack performance and memory usage, please include the trace file in your GitHub issue 1. This helps the Next.js team investigate and improve performance metrics.