Skip empty parallel route slot directories instead of erroring#92708
Skip empty parallel route slot directories instead of erroring#92708feedthejim wants to merge 1 commit intocanaryfrom
Conversation
|
All broken links are now fixed, thank you! |
Empty @-prefixed directories with no route files (e.g. leftover empty directories from branch switches) caused a build error requiring a default.js. Both webpack and Turbopack now check that @-slot directories contain actual route files before treating them as parallel route slots. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fc7e720 to
2767417
Compare
Failing test suitesCommit: 2767417 | About building and testing Next.js
Expand output● parallel-routes-leaf-segments-no-build-error › leaf segment without child routes › should render the leaf segment page with all parallel slots ● parallel-routes-leaf-segments-no-build-error › leaf segment with route groups › should render leaf segment with route groups and parallel slots ● parallel-routes-leaf-segments-no-build-error › leaf segment with catch-all parameter › should render catch-all segment with multiple path segments ● parallel-routes-leaf-segments-no-build-error › no children slot › should render the no children slot ● parallel-routes-leaf-segments-no-build-error › empty parallel route slot › should build and render successfully when a parallel route directory is empty ● parallel-routes-leaf-segments-no-build-error › empty parallel route slot › should render child routes despite the empty parallel route directory
Expand output● instant-navigation-testing-api › runtime params are excluded from instant shell › does not include cookie values in instant shell during page load |
Merging this PR will not alter performance
Comparing Footnotes
|
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
Summary
@-prefixed directories with no route files (e.g. leftover empty directories from branch switches or stale git state) caused a build error:Missing required default.js file for parallel route@-slot directories actually contain route files before treating them as parallel route slotsdefault.jsWebpack (
next-app-loader)directoryHasFiles()helper that recursively checks for non-dotfilesresolveAdjacentParallelSegmentsnow skips empty@directoriesTurbopack (
app_structure.rs)AppDirModules::is_empty()andPlainDirectoryTree::has_any_route_files()Test plan
@empty-slotdirectory containing empty catch-all subdirectories🤖 Generated with Claude Code