build time is crazy

Hello guys ! I'm using t3 + turborepo, which looked like a very promising solution. Unfortunately, the build times are completely out of control. 45 seconds for a simple pages, dozens of minutes for a full build. did you have a similar experience ? my build script is "build": "pnpm with-env next build --turbopack", the dev is
"dev": "NEXT_TURBOPACK_TRACING=1 pnpm with-env next dev -p 3030 --turbopack", with next: ^15.3.0 and react 19.1 in my page folders, i have a layout with a "prefetch" and a page with "useSuspenseQuery" do you see anything that could be wrong or any antipattern here ? I added my trace analysis if it helps you understand Thank you so much for your help ❤️
No description
1 Reply
.361 °
.361 °3mo ago
From my experience, turbopack building is not fully optimized for production still. Try back to use webpack for build; Do not append NEXT_TURBOPACK_TRACING=1 in dev command. Disable it to avoid extra overhead. To avoid long build time, do not use useSuspenseQuery in layout level. Only use it in individual page/components level. Also for deep large layout trees, do not use prefetch. Simply disable it like prefetch={false}

Did you find this page helpful?