Summary
The on-startup production build must complete within Harper's 30 s handleApplication timeout. A real cold next build (Next.js 16, webpack) does not finish in 30 s, so Harper aborts the component load before the build produces a .next — the app never serves.
This surfaces once you set bundler: webpack to sidestep the Turbopack crash (filed separately): with webpack there's no crash, just a timeout.
Environment
- Harper (harper-pro) 5.1.23, multi-node replicated cluster
@harperfast/nextjs 2.2.3
next 16.2.11, React 19 (App Router)
- Component config:
'@harperfast/nextjs': { package: '@harperfast/nextjs', bundler: webpack }
What happens
Error: Could not load component '@harperfast/nextjs' for application '<app>' due to:
handleApplication timed out after 30000ms for @harperfast/nextjs on behalf of <app>
No build error and no crash — the webpack build is still running when Harper's 30 s component-load deadline fires and tears it down. GET / returns 500 for the life of the component.
Root cause
handleApplication runs the full next build inline (build() → withBuildLock → runNextBuild) and must return within the fixed 30 s component-load budget. Even a trivial app's cold Next 16 build exceeds that on the cluster, so the build is aborted every time. Because the abort happens mid-build, no .next/BUILD_ID is ever produced and subsequent restarts repeat the timeout.
Reproduce
- Minimal Next.js 16 app +
@harperfast/nextjs with bundler: webpack.
- Deploy to a cluster;
GET / → 500 "handleApplication timed out after 30000ms".
Impact
Even with the Turbopack crash worked around, the server-side-build model can't complete within the component-load window. Combined with the Turbopack issue, neither bundler can do an on-startup build on a real cluster today.
Possible directions
- Do the build off the
handleApplication critical path (e.g. build asynchronously and serve once .next is ready / return fast and mark the component "building"), rather than blocking the component load on a full next build.
- Make the build timeout configurable / much larger for this plugin, and/or persist a completed build so restarts don't rebuild from scratch.
- A dedicated build step /
buildOnly at deploy time, then serve prebuilt.
Workaround
prebuilt: true — build .next ahead of time and ship it; the plugin skips building entirely, so there's no build to time out. Verified working on 5.1.23.
Related
Summary
The on-startup production build must complete within Harper's 30 s
handleApplicationtimeout. A real coldnext build(Next.js 16, webpack) does not finish in 30 s, so Harper aborts the component load before the build produces a.next— the app never serves.This surfaces once you set
bundler: webpackto sidestep the Turbopack crash (filed separately): with webpack there's no crash, just a timeout.Environment
@harperfast/nextjs2.2.3next16.2.11, React 19 (App Router)'@harperfast/nextjs': { package: '@harperfast/nextjs', bundler: webpack }What happens
No build error and no crash — the webpack build is still running when Harper's 30 s component-load deadline fires and tears it down.
GET /returns 500 for the life of the component.Root cause
handleApplicationruns the fullnext buildinline (build()→withBuildLock→runNextBuild) and must return within the fixed 30 s component-load budget. Even a trivial app's cold Next 16 build exceeds that on the cluster, so the build is aborted every time. Because the abort happens mid-build, no.next/BUILD_IDis ever produced and subsequent restarts repeat the timeout.Reproduce
@harperfast/nextjswithbundler: webpack.GET /→ 500 "handleApplication timed out after 30000ms".Impact
Even with the Turbopack crash worked around, the server-side-build model can't complete within the component-load window. Combined with the Turbopack issue, neither bundler can do an on-startup build on a real cluster today.
Possible directions
handleApplicationcritical path (e.g. build asynchronously and serve once.nextis ready / return fast and mark the component "building"), rather than blocking the component load on a fullnext build.buildOnlyat deploy time, then serveprebuilt.Workaround
prebuilt: true— build.nextahead of time and ship it; the plugin skips building entirely, so there's no build to time out. Verified working on 5.1.23.Related
bundler: webpackin the first place.