Skip to main content

Command Palette

Search for a command to run...

Fixing the Mysterious 404 When Deploying Angular 19 to Vercel

Updated
2 min read
H

Software developer documenting my journey through web and mobile development. I share what I learn, build, and struggle with—from React to SwiftUI, architecture decisions to deployment challenges. Not an expert, just passionate about coding and learning in public. Join me as I navigate the tech landscape one commit at a time.

TL;DR

When deploying Angular 19 apps to Vercel, override the output directory setting to dist/[your-app-name]/browserto avoid the dreaded 404 page if you use the @angular-devkit/build-angular:application builder

The Backstory

There I was, feeling accomplished after building my shiny new Angular 19 app. "Time to deploy!" I thought gleefully. I connected my GitHub repo to Vercel, watched the build succeed with flying colors, and then... 404. The digital equivalent of showing up to a party at the wrong address. What gives, Vercel?

The Problem

Angular 19 uses the @angular-devkit/build-angular:application builder as the default builder. However, Vercel stubbornly expects you to be using the @angular-devkit/build-angular:browser builder, and its deployment settings are configured accordingly.

// What Angular 19 has in angular.json
"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:application",
    // ...which outputs files to a different location than Vercel expects
  }
}

When Vercel tries to serve your app, it's looking in the wrong place – like a delivery driver dropping your pizza at your neighbor's house, it sucks.

The Insight

The fix is surprisingly simple: you need to explicitly tell Vercel where your application's output is located. In the Vercel deployment settings, you must override the default output directory path.

Set your Vercel build output directory to:

dist/[your-app-name]/browser

For example, in my case:

dist/play-pulse/browser

This tells Vercel: "Hey, don't look in the usual place. The party's over here!"

Why It Matters

This small configuration hiccup can cause a lot of head-scratching and time wasted debugging deployments. Angular's evolution to the new application builder is great for development, but deployment platforms need time to catch up. Understanding these nuances between your build tools and deployment platforms is crucial for smooth DevOps.

today i learned

Part 2 of 6

Daily code discoveries from my developer journey. Each post delivers concise, actionable insights I've uncovered while building with React, Typescript, and more. Brief but impactful lessons for curious developers looking to grow incrementally.

Up next

Why .bind(this) put me through hell

The Backstory I was peacefully implementing authentication for an Angular app, sipping my coffee, feeling productive. I added a simple tap operator to my login method to store the JWT token in localStorage. Easy-peasy, right? Wrong. The injected Stor...

More from this blog

C

Code Craft by Hermann Kao | Fullstack Development Learning Journey & Tutorials

22 posts

Following my journey through web and mobile development—sharing insights, challenges, and lessons learned as I build with React, SwiftUI, and more. Learning in public, one commit at a time.