Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Empty slot directory causes error in production build | GoodFirstPicks

Empty slot directory causes error in production build

vercel/next.js 1 comments 1mo ago
View on GitHub
lowopenScope: clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Issue appears resolved in newer versions, reducing urgency.

AI Summary

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.

Issue Description

Link to the code that reproduces this issue

https://github.com/foxable/reproduction-next-empty-slot-dir

To Reproduce

  1. Create production build: pnpm build

Current vs. Expected behavior

Current 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.

Provide environment information

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

Which area(s) are affected? (Select all that apply)

Runtime

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

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.

GitHub Labels

Runtime

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • issue may already be fixed in newer versions
Loading labels...

Details

Points10 pts
Difficultylow
Scopeclear
Skill Matchmaybe
Test Focusedno