Issue appears resolved in newer versions, reducing urgency.
The issue involves a build error caused by empty slot directories in Next.js, which fails in version 15.2.3 but is reportedly fixed in version 16.1.6. The problem is well-defined and the fix seems straightforward, but the issue may no longer be relevant for newer versions.
https://github.com/foxable/reproduction-next-empty-slot-dir
pnpm buildCurrent behavior: When there is an empty slot directory under /app, the build will fail with the following error:
src/app/layout.tsx
Type error: Type 'Readonly<{ children: ReactNode; }>' does not satisfy the constraint 'LayoutProps'.
Property 'slot' is missing in type 'Readonly<{ children: ReactNode; }>' but required in type 'LayoutProps'.
Expected behavior: The empty slot directory should be ignored during build, not causing the build to fail.
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Thu, 13 Mar 2025 18:12:00 +0000
Available memory (MB): 31793
Available CPU cores: 16
Binaries:
Node: 22.13.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: 10.6.3
Relevant Packages:
next: 15.2.3 // Latest available version is detected (15.2.3).
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.8.2
Next.js Config:
output: N/A
Runtime
next build (local)
Empty slot directories can be a leftover from moving pages within the App Router, because they are not automatically removed by Git. While this is not a problem for the original author who moved the files, other developers checking out the changed page structure will stumble upon a failing build.
While it's easy to fix the problem after identifying the cause, it's easy to forget cleaning up empty directories. The developer experience would be improved if the build would be more forgiving, ignoring empty slot directories.
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!