-
Notifications
You must be signed in to change notification settings - Fork 84
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 build fail Unexpected token 'E', "Environmen"... is not valid JSON #2500
Comments
Issue has to do with expo-update, after removing it build went through |
Hi @kaleb-dev, What does your CC: @wschurman eas-cli/packages/eas-cli/src/project/resolveRuntimeVersionAsync.ts Lines 44 to 49 in fdbeb86
|
utility function to build for different environments based on EAS env configuration in my eas.json |
If that function runs during app json evaluation, the |
I'm getting the uncheck for How do I solved it? |
For "Check for app config fields that may not be synced in a non-CNG project" Took me a minute but realised the easiest solution for this issue is to just remove android and ios directories from git (and add them to the .gitignore so they dont come back). You can still build locally, its just EAS doesnt like those directories to be fixed in your git repo. |
Build/Submit details page URL
No response
Summary
I'm encountering an error when attempting to build my Expo React Native app using EAS Build for iOS. When running the command eas build --platform ios --profile preview, the build process fails with a JSON parsing error: "Unexpected token 'E', "Environmen"... is not valid JSON". This occurs despite having a properly configured eas.json file with different build profiles, including a "preview" profile that sets APP_VARIANT to "stage". My project uses a custom app.config.ts file to configure the app based on different environments, determined by an environmentUtil function. Ran the same code on another developers system and no error
Managed or bare?
Managed
Environment
expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.6.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
Watchman: 2024.08.12.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
Android SDK:
API Levels: 34
Build Tools: 30.0.3, 33.0.1, 34.0.0, 35.0.0, 35.0.0
System Images: android-28 | Google APIs ARM 64 v8a, android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
IDEs:
Android Studio: 2024.1 AI-241.15989.150.2411.11948838
Xcode: 15.4/15F31d - /usr/bin/xcodebuild
npmPackages:
expo: ^51.0.28 => 51.0.28
expo-router: ~3.5.23 => 3.5.23
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.74.5 => 0.74.5
react-native-web: ~0.19.6 => 0.19.12
npmGlobalPackages:
eas-cli: 10.2.3
Expo Workflow: bare
✔ 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 for issues with metro config
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check native tooling versions
✔ 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
✔ Check that packages match versions required by installed Expo SDK
Didn't find any issues with the project!
Error output
Compressing project files and uploading to EAS Build. Learn more
✔ Uploaded to EAS
Unexpected token 'E', "Environmen"... is not valid JSON
SyntaxError: Unexpected token 'E', "Environmen"... is not valid JSON
at JSON.parse ()
at resolveRuntimeVersionAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/project/resolveRuntimeVersionAsync.js:22:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createAndMaybeUploadFingerprintAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/build.js:431:36)
at async prepareBuildRequestForPlatformAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/build.js:81:29)
at async prepareIosBuildAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/ios/build.js:60:12)
at async startBuildAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/runBuildAndSubmit.js:286:33)
at async prepareAndStartBuildAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/runBuildAndSubmit.js:274:19)
at async runBuildAndSubmitAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/build/runBuildAndSubmit.js:102:49)
at async Build.runAsync (/Users/kalebtessema/.nvm/versions/node/v20.16.0/lib/node_modules/eas-cli/build/commands/build/index.js:42:9)
Reproducible demo or steps to reproduce from a blank project
Running
eas build --platform ios --profile preview
, or any other eas build command i get the following errorThe text was updated successfully, but these errors were encountered: