framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.06k stars 3.23k forks source link

React & vite js doesn't load .env values #4056

Closed vitalijalbu closed 2 years ago

vitalijalbu commented 2 years ago

Describe the bug

Just started a new blank vite js and f7 template, but cannot import values from .env files.

To Reproduce

Steps to reproduce the behavior:

  1. create .env file
  2. add some values starting with VITE_ (ex: VITE_API_URL)
  3. console.log(import.meta.env.VITE_API_URL) in any js file
  4. See undefined value

Expected behavior

2-3 moths ago, i think with the f7 version 7.0.1 or 7.0.0 it worked perfectly.

Screenshots

https://t.me/framework7ru/4821

nolimits4web commented 2 years ago

How this is related to Framework7? .env file must be in Vite project root, which is the src folder

petersahanaya commented 1 year ago

it still say's undefine idk why i put the .env in src folder but is still undefine. can anyone help me ?