Actually I’m kind of surprised that it worked in CRA as well. It was not supposed to. This would shed some light:
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Unable to access Netlify environment variables when using Vite with react | 8 | 7263 | February 19, 2023 | |
| React Vite environment variables deployed with CircleCI | 2 | 2262 | July 7, 2022 | |
| Can't access environment variables in Vite Vue deploy | 4 | 1732 | March 27, 2023 | |
| Environment Variables | 6 | 2119 | April 11, 2023 | |
| Access Prerendered React App Default Netlify Environment Variables | 1 | 684 | October 25, 2020 |