Skip to content

App Router: trailingSlash not applied to route handlers #1827

@james-elicx

Description

@james-elicx

This issue was created by an agent auditing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-06-08).

Problem

The trailingSlash config is not applied to App Router route handlers (app/**/route.ts). Both the edge and node runtime variants fail.

Affected Test Suites

  • test/e2e/app-dir/app-routes-trailing-slash/app-routes-trailing-slash.test.ts (2 failures)
    • should handle trailing slash for edge runtime
    • should handle trailing slash for node runtime

Estimated impact

~2 e2e failures.

Notes

The closed #1332 covered trailingSlash for pages/app pages; this is the route-handler path, which is currently untracked.

Recommendation

  1. Reproduce: an app/api/foo/route.ts with trailingSlash: true and assert /api/foo redirects to /api/foo/ (and vice-versa for false), for both runtimes.
  2. Apply the trailing-slash normalization/redirect to the route-handler dispatch path, not just page rendering.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions