-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EAS Update not working EXPO_ROUTER_APP_ROOT is not defined #2010
Comments
I found the problem: in front of my eas command, i had this:
which was not required anymore because i was using the env in the eas.json and not my .env.test And i saw in the expo router code that the EXPO_ROUTER_APP_ROOT is ignore in
I remove the NODE_ENV=test and everything is good. |
How can we handle a staging .env file ? i tried using .env.staging but expo throw that this file is not supported.. |
NODE_ENV=staging at the build time, it will load env from .env.staging , I am also going to implement this in this week. |
@agrittiwari it doesnt work if you use eas cli because .env.staging is not a supported file. Im getting an error message saying this. You can only use .env.production and same with additionnal .local extension |
Hey @oliviercperrier have you find a way to work around this? I was also using |
I'm also facing a similar issue, but I'm not using EAS. I need to load my test environment variables when running error: node_modules/expo-router/_ctx.ios.js: node_modules/expo-router/_ctx.ios.js:Invalid call at line 2: process.env.EXPO_ROUTER_APP_ROOT
First argument of `require.context` should be a string denoting the directory to require. |
standard .env is not enough. NODE_ENV=test behaviour seems different so it's not suitable to replace staging env. Hope expo can support more in |
You da real MVP! |
Permalink to the code in OP's comment describing the root cause: https://github.com/expo/expo/blob/a52d0a5e71c01673ee920c83565e759ca2165d5c/packages/babel-preset-expo/src/expo-router-plugin.ts#L56C13-L68C14 |
Build/Submit details page URL
No response
Summary
I recently switch using default Expo environment variables for eas. So i defined all my env variables in my eas.json. Since i made that change, eas update is no longer working.
Running:
eas update --branch preview --platform ios
doesn't work anymore.eas build and local development is working fine tho.
Managed or bare?
Managed
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 13.4
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmPackages:
@expo/metro-config: ^0.10.6 => 0.10.7
expo: ^49.0.5 => 49.0.7
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.72.3 => 0.72.3
react-native-web: ~0.19.6 => 0.19.7
npmGlobalPackages:
eas-cli: 3.16.0
expo-cli: 6.3.10
Expo Workflow: managed
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK
Didn't find any issues with the project!
Error output
After Running:
eas update --branch preview --platform ios
[expo-cli] Using src/app as the root directory for Expo Router.
[expo-cli] Experimental path aliases feature is enabled. Learn more: https://docs.expo.dev/guides/typescript/#path-aliases
[expo-cli] Starting Metro Bundler
[expo-cli]
[expo-cli]
[expo-cli] SyntaxError: node_modules/expo-router/_ctx.ios.tsx: node_modules/expo-router/_ctx.ios.tsx:Invalid call at line 2: process.env.EXPO_ROUTER_APP_ROOT
[expo-cli] First argument of
require.context
should be a string denoting the directory to require.[expo-cli] Error: node_modules/expo-router/_ctx.ios.tsx:Invalid call at line 2: process.env.EXPO_ROUTER_APP_ROOT
[expo-cli] First argument of
require.context
should be a string denoting the directory to require.Reproducible demo or steps to reproduce from a blank project
The text was updated successfully, but these errors were encountered: