← All case studies Heroku → Vercel

Angular apps left Heroku the week the free dynos ended

A few Angular SSR apps moved from Heroku to Vercel in November 2022, the week free dynos ended. One build error cleared after Node was set to 14.x. The post does not move a database.

Stephen Mitchell published this on 25 November 2022. It is a short post. He had a few Angular projects on Heroku, and he wanted a host that was still free and still fast. He picked Vercel.

He quotes Heroku’s own cutoff. Starting 28 November 2022, free dynos, free Heroku Postgres, and free Heroku Data for Redis would go away. Existing free dynos would be scaled down, and free databases deleted. His post is about the web apps. He does not describe moving Postgres or Redis.

The Heroku → Vercel playbook covers config vars, workers, and a database. Mitchell’s page is the Angular SSR shell around a Git deploy.

The files he changed

In the project folder he deleted the Procfile. In package.json he replaced the Heroku start script with a vercel-build script that runs npm run build:ssr.

He added api/index.js. That file loads the built server and exports server.app(). The path in the post is dist/PROJECT_NAME/server/main. PROJECT_NAME is his placeholder, so swap in the real Angular output folder.

He added a vercel.json. Version 2, public true, a rewrite of every path to /api, and includeFiles so the function can see dist/PROJECT_NAME/browser. The name in his sample is test-universal. Same warning. It is a sample name.

Then he dropped the heroku git remote, pushed the repo to GitHub, and imported that repo in the Vercel dashboard. The GitHub URL in the post is also a placeholder, GIT_NAME-git/REPO.

The one error he names

Vercel built and deployed the project when the build was clean. He hit one error. Setting the Node version to 14.x in the project settings fixed it. He does not paste the error text.

There is no downtime figure, and no bill, beyond the fact that the Heroku free tier was about to disappear.

If your app is this shape, an Angular server build plus a rewrite onto one function, his file list is the whole migration he published. If the app also has Heroku Postgres, a worker, or a scheduler, this post does not cover them. Do that with the playbook before you delete the Heroku remote. And if the build fails on the first import, the only fix he records is the Node version.