I started a React project for mobiles and I reached the point when I need Environmental variables for the configuration.

The problem is ChatGPT shares the same knowledge for NextJS and Ionic. It was suggesting me just to keep using “process.env.VARIABLE_NAME” but “process” dies in Ionic before the client.

By default I was using Vite without noticing. So instead of:

const foo = process.env.REACT_APP_NAME

I have to use:

const foo  = import.meta.env.VITE_NAME;

Now I can see the value