Open BaffinLee opened 10 months ago
I'm facing the same issue, do you have some workaround for this?
I'm facing the same issue, do you have some workaround for this?
Metro works, but some behavior is different than Webpack https://docs.expo.dev/guides/customizing-metro/
Summary
Accourding to expo docs https://docs.expo.dev/guides/environment-variables/
Enviroment variables starts with
EXPO_PUBLIC_
in.env
file should be accessable withprocess.env
after expo SDK 49, but which is not when a project is bundled by webpack for web platform.Environment
expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.19045 Binaries: Node: 18.17.1 - D:\software\nodejs\node.EXE Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD npm: 9.6.7 - D:\software\nodejs\npm.CMD npmPackages: @expo/webpack-config: ^19.0.0 => 19.0.0 expo: ~49.0.15 => 49.0.16 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.72.6 => 0.72.6 react-native-web: ~0.19.6 => 0.19.9 Expo Workflow: managed
Please specify your device/emulator/simulator platform, model and version
web
Error output
No response
Reproducible demo or steps to reproduce from a blank project
create a file name
.env
, putEXPO_PUBLIC_API_PATH=/
in ituse this enviroment variable in
App.js
, like thisconsole.log(process.env.EXPO_PUBLIC_API_PATH)