---
title: "Moving Railway's Frontend Off Next.js"
description: "Railway migrated its entire production frontend (dashboard, canvas, marketing site, 200+ routes) from the Next.js Pages Router to Vite + TanStack Router/Start in two PRs with zero downtime."
url: "https://swe.quest/articles/moving-railway-s-frontend-off-next-js-a0f8a20e0dc7a7ef"
canonical: "https://blog.railway.com/p/moving-railways-frontend-off-nextjs"
source: "Railway"
published: "2026-04-03"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["frontend","react","refactoring","build-systems","cdn-edge"]
---

# Moving Railway's Frontend Off Next.js

A post on [Railway](https://swe.quest/sources/railway.md), published 2026-04-03, 5 min read, Case study. Original: [https://blog.railway.com/p/moving-railways-frontend-off-nextjs](https://blog.railway.com/p/moving-railways-frontend-off-nextjs)

## Summary

Railway migrated its entire production frontend (dashboard, canvas, marketing site, 200+ routes) from the Next.js Pages Router to Vite + TanStack Router/Start in two PRs with zero downtime. The first PR removed all Next.js-specific dependencies such as next/image, next/head and next/router. The second swapped the framework, generating routes from the original page tree, moving 500+ redirects, headers and caching rules into Nitro config, and replacing Node polyfills with browser-native APIs. Builds dropped from over 10 minutes to under two. Railway gave up built-in image optimization (now handled by Fastly at the edge) and some ecosystem plugins, and accepted the immaturity of TanStack Start.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [CDN & edge](https://swe.quest/tags/cdn-edge.md) (Infrastructure)

## Prerequisites

- React ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- Next.js Pages Router ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- frontend build tooling ([easy posts on Frontend](https://swe.quest/tags/frontend.md?difficulty=easy))

## Keywords

Next.js, Vite, TanStack Router, TanStack Start, Nitro, Fastly, Railway

## Related posts

- [How to Migrate from Cloudflare Pages to Railway](https://swe.quest/articles/how-to-migrate-from-cloudflare-pages-to-railway-c434bad6d6a93d97.md): Railway · 2024-12-13 · Medium · 9 min read · Deployment, Serverless, Containers, JavaScript
  Moving a site from Cloudflare Pages to Railway follows one shared procedure: link the GitHub repo to a Railway service, set environment variables and build/start commands, deploy, then delete the Cloudflare project.
- [Two years of Next.js at Artsy: A Retrospective](https://swe.quest/articles/two-years-of-next-js-at-artsy-a-retrospective-5d8ffb60445d7dd1.md): Artsy Engineering · 2024-03-07 · Medium · 12 min read · React, Frontend, Developer productivity, TypeScript
  Artsy found Next.js's pages router excellent: a platform team unfamiliar with modern front-end rebuilt an internal tools app in months.
- [Why We Ripped Twin out of 400+ Components](https://swe.quest/articles/why-we-ripped-twin-out-of-400-components-f0b99539dbfc3cb4.md): Railway · 2023-05-04 · Medium · 7 min read · CSS, Frontend, Refactoring & migrations, Build systems, React
  Railway replaced twin.macro with vanilla Tailwind across 400+ React components, which removed the last dependency on Babel and let the monorepo move fully to SWC.
- [What We Learned Migrating From Webpack to Vite](https://swe.quest/articles/what-we-learned-migrating-from-webpack-to-vite-14623bb3ac0e8ed2.md): Neon · 2024-11-20 · Medium · 5 min read · Frontend, Build systems, Developer productivity, JavaScript
  Neon moved its console, a set of SPAs whose HTML is rendered by a Go backend, from webpack to Vite.
- [Artsy Mobile 2025 Wrapped](https://swe.quest/articles/artsy-mobile-2025-wrapped-2eb10f2f6653645f.md): Artsy Engineering · 2026-01-09 · Medium · 7 min read · Mobile, React, Performance engineering, CI/CD, Refactoring & migrations
  Artsy's React Native apps (Eigen, Folio, Palette Mobile) adopted Expo and over-the-air updates after VS App Center's retirement, and all three moved to the new architecture.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
