Skip to content

[Bug] Specific /index route fails to render in Next.js 15.5.2 while other similar routes work correctly #83369

@childrentime

Description

@childrentime

Link to the code that reproduces this issue

https://github.com/childrentime/index-route-test

To Reproduce

In Next.js 15.5.2, the specific /index route fails to render with a WebSocket/HMR error, while other similar nested routes (like /index1, /index2, etc.) work perfectly fine. This appears to be a specific issue with the /index path rather than a general routing problem.

Create a Next.js 15.5.2 project with Pages Router
Create the following file structure:
pages/
├── index.tsx # Root page (/)
├── index/
│ └── index.tsx # Should serve /index route
└── index1/
└── index.tsx # Serves /index1 route (works fine)
Start the development server with next dev
Navigate to /index1 - ✅ Works correctly
Navigate to /index - ❌ Fails with rendering error

Current vs. Expected behavior

Expected Behavior
The /index route should render the content from pages/index/index.tsx successfully
Should behave identically to other nested routes like /index1
Actual Behavior
Accessing /index results in a rendering failure with the following error:
ot-reloader-pages.js:199:17)
at eval (hot-reloader-pages.js:72:13)
at WebSocket.handleMessage (websocke
The page fails to render and shows a blank screen or error state
Other routes like /index1 work without any issues

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:52 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.11.1
  npm: 10.2.4
  Yarn: 1.22.21
  pnpm: 10.15.0
Relevant Packages:
  next: 15.5.2 // Latest available version is detected (15.5.2).
  eslint-config-next: 15.5.2
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

Pages Router

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

next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pages RouterRelated to Pages Router.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions