Add a custom domain to a branch doesn't work

I have two branches on my GitHub repo: main and staging.

I followed this guide to set up the custom domain to deploy the changes made to the staging branch.

I also modified the DNS to have the CNAME record staging points to

However, when I navigate to, I got this:

This page isn’t working is currently unable to handle this request.


What did I miss?

The guide I followed was this one:

What’s the domain and

it’s and

The error is coming from the Function. It’s doing a env.ASSETS.fetch which returns a 404 and then the Function is returning 500

You will need to debug the Function to see why that is happening and fix it.


Thank you. It turns out the env vars didn’t get copied over to the preview branch.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.