Remix Vite - env variables not loading in Cloudflare Pages

For Workes & Pages, what is the name of the domain?

N/A

What is the error number?

N/A

What is the error message?

Build environment variables: (none found)

What is the issue or error you’re encountering

I have some environment variables like “VITE_APP_HOST”, but they are not getting changed during “npm run build”

What steps have you taken to resolve the issue?

There’s not much resource or help articles regarding environment variables for “Cloudflare remix vite” setup. So, I don’t have an idea.

What are the steps to reproduce the issue?

Deploy a remix application via Github to Cloudflare pages with environment variables. Build gets deployed properly, but the environment variables doesn’t seem to be used during the build time. I used the environment variables in the fetch requests, but I get undefined.

Screenshot of the error