Can't get access to Environment in Static Site

Hello there. I have a vue app created by ‘vue create’ command.
So, what i have:

  1. .js file:
const URL = process.env.BACKEND_URL || 'http://localhost:8081';

export default URL;
  1. created Environment in BACKEND_URL with a value (URL of my backend)

But its always has http://localhost:8081 as URL

What did i wrong? Please help !

p.s. saw similar theme (React static Site env), but it didnt help me anyway

Solved. Environment variables need

VUE_APP_

as prefix to work for React.

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