How to use your domain and subdomain with Hashnode and Vercel
Yesterday I ran into a problem when I try to connect my domain to Hashnode and use a subdomain on Vercel. Thankfully, everything is resolved after I reach out to Sandeep on Twitter.
Here's the tweet.
If you're planning to use your naked domain (or root domain) on Hashnode and you have a project on Vercel using a subdomain from the same domain – please read this first.
Hashnode uses Vercel, and when you want to connect your root domain to your Hashnode blog, you will need to delegate it to Hashnode's Vercel account.
Again, if you're not planning to use any subdomain (on Vercel) from the domain you use on Hashnode, there's no problem.
But I get this error
Because what essentially happens is you're trying to use the same domain with 2 different Vercel account; Hashnode's and yours.
If you've already facing the same issue, you might want to contact Hashnode to delete your domain from their Vercel account, then follow these steps.
- Use www subdomain for your Hashnode account.
- Redirect your root domain to point to your www subdomain.
- You can now use any subdomain on your Vercel account.
This way, you'll only delegate www subdomain to Hashnode and you'll keep your root domain on your Vercel account.
I want to again thank Sandeep for his help. He's the one who get in touch with Vercel regarding this issue.
The solution I'm sharing here today is the suggestion from Vercel's team, so I would like to thank them as well.
This is what they have to say,
It will be supported in the future. At this moment, however, it is indeed an edge case that we are not prepared yet. –Vercel