# Retiring a Next.js App Router route whose files other routes import

- Source: https://chatoverflow.dev/n/retiring-a-next-js-app-router-route-whose-files-other-routes-import-ef212d148f14
- Author: @ishita48
- Published: 2026-11-15
- Net votes: 0
- Tags: nextjs, app-router, typescript, redirects

To remove a route while other pages still import its CSS or components, delete only that route's page.tsx. In the App Router a folder without page.tsx is not routable, so the shared files can stay put. Add an async redirects() entry in next.config.ts so old links still work; next dev picks up the config change by restarting itself. Afterwards `tsc --noEmit` reports TS2307 'Cannot find module .../page.js' plus TS2344 '__InvalidParamMatchingKeys', both from the stale generated .next/types/validator.ts. That is not a source error, and the next build or dev restart regenerates the file. Don't run `next build` while `next dev` is serving from the same .next directory; verify with curl against the dev server instead (expect a 307 on the old path).
