question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EXPO - EAS build failing

See original GitHub issue

Current Behavior

Hi, I’m currently migrating two repos to an NX mono repository (React.JS + Expo).

Everything was going well until yesterday. All my EAS builds are failing and I can’t understand why (they worked perfectly fine when I used a standalone repo)

Expected Behavior

The EAS build should be succeeded when using @nrwl/expo:build.

Github Repo

No response

Steps to Reproduce

https://github.com/yonitou/example

  1. Go to the GitHub repo above
  2. Run npm install
  3. nx build native-app --configuration=simulator
  4. Wait

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 16.13.1
   OS   : darwin arm64
   npm  : 8.3.0
   
   nx : 15.0.13
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.0.13
   @nrwl/detox : 15.1.1
   @nrwl/devkit : 15.0.13
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.0.13
   @nrwl/expo : 15.1.1
   @nrwl/express : Not Found
   @nrwl/jest : 15.1.1
   @nrwl/js : 15.0.13
   @nrwl/linter : 15.0.13
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.0.13
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.1.1
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.0.13
   @nrwl/web : 15.1.1
   @nrwl/webpack : 15.1.1
   @nrwl/workspace : 15.0.13
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:


### Failure Logs

```shell
The failure logs provided by EXPO are : 


 FAILURE: Build failed with an exception.
49
[stderr] * Where:
50
[stderr] Script '/home/expo/workingdir/build/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 250
51
[stderr] * What went wrong:
52
[stderr] A problem occurred evaluating script.
53
[stderr] > Calling `[node, /home/expo/workingdir/build/node_modules/@react-native-community/cli/build/bin.js, config]` finished with an exception. Error message: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object
54
[stderr]   
55
[stderr]   The current character read is 'i' with an int value of 105
56
[stderr]   Unable to determine the current character, it is not a string, number, array, or object
57
[stderr]   line number 1
58
[stderr]   index number 0
59
[stderr]   info Run CLI with --verbose flag for more details.
60
[stderr]   ^. Output: info Run CLI with --verbose flag for more details.


### Additional Information

_No response_

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yonitoucommented, Nov 18, 2022

Hey ! Thanks for your help.

I just ran nx migrate latest. It worked without any errors but it doesn’t change anything. It really feels like my package-lock.json is kind of corrupted but I deleted it and it changed nothing … I’m running out of ideas, did you have a look on my repository that I shared ? I really need some help 😦

0reactions
yonitoucommented, Nov 21, 2022

Yes maybe, the thing is I’m not even using expo-status-bar so I don’t know why is it even an issue. Here the steps I had to follow to fix everything :

  • I removed expo-status-bar from my root package.json
  • I deleted my package-lock.json & my node_modules
  • I ran npm install (at the workspace level)
  • Then, when I ran nx start my-app (which is the target executor to launch my expo server), I had a new very weird issue :
TypeError: Class extends value undefined is not a constructor or null    
at Object.<anonymous> (/Users/yonitouboul/code/yonitou/hygo-frontend/node_modules/fork-ts-checker-webpack-plugin/lib/issue/issue-webpack-error.js:11:51)
  • After searching for 4 hours, I decided to install webpack@5.75.0 at my root package.json
  • nx start my-app was working so I decided to remove webpack from my package.json to be sure that this was the fix and … it worked anyway (because the package-lock.json stayed unmodified)

The builds are now working perfectly but it was a hell of a challenge. I suspect that something is wrong with the package-lock.json. Would be very happy if you have any answers to provide. Here’s my final package.json =>

{
	"name": "hygo-frontend",
	"version": "0.0.0",
	"license": "MIT",
	"scripts": {
		"start": "nx serve",
		"build": "nx build",
		"test": "nx test",
		"prepare": "husky install"
	},
	"private": true,
	"dependencies": {
		"@amplitude/react-native": "^2.15.0",
		"@expo/metro-config": "0.3.22",
		"@expo/webpack-config": "^0.17.2",
		"@logrocket/react-native": "^1.6.2",
		"@ptomasroos/react-native-multi-slider": "https://github.com/ptomasroos/react-native-multi-slider",
		"@reach/dialog": "^0.18.0",
		"@react-google-maps/api": "^2.7.0",
		"@react-native-async-storage/async-storage": "~1.17.3",
		"@react-native-community/datetimepicker": "6.5.2",
		"@react-native-community/hooks": "^2.8.1",
		"@react-native-community/netinfo": "9.3.5",
		"@react-navigation/bottom-tabs": "^6.0.7",
		"@react-navigation/drawer": "^6.1.6",
		"@react-navigation/elements": "^1.2.1",
		"@react-navigation/material-top-tabs": "^6.0.6",
		"@react-navigation/native": "^6.0.4",
		"@react-navigation/native-stack": "^6.2.5",
		"@react-navigation/stack": "^6.0.9",
		"@sentry/react": "^6.19.2",
		"@sentry/react-native": "4.2.2",
		"@sentry/tracing": "^6.19.2",
		"axios": "^0.27.2",
		"classnames": "^2.3.1",
		"date-fns": "^2.28.0",
		"dotenv": "^16.0.1",
		"expo": "^47.0.0",
		"expo-application": "~5.0.1",
		"expo-asset": "~8.6.2",
		"expo-barcode-scanner": "~12.0.0",
		"expo-camera": "~13.0.0",
		"expo-constants": "~14.0.2",
		"expo-dev-client": "~2.0.0",
		"expo-device": "~5.0.0",
		"expo-font": "~11.0.1",
		"expo-linear-gradient": "~12.0.1",
		"expo-localization": "~14.0.0",
		"expo-notifications": "~0.17.0",
		"expo-splash-screen": "~0.17.5",
		"expo-status-bar": "~1.4.2",
		"expo-task-manager": "~11.0.1",
		"expo-updates": "~0.15.5",
		"flagged": "^2.0.6",
		"husky": "^8.0.1",
		"i18next": "^21.8.11",
		"i18next-browser-languagedetector": "^6.1.4",
		"i18next-http-backend": "^1.4.1",
		"intl": "^1.2.5",
		"intl-pluralrules": "^1.3.1",
		"lodash": "^4.17.21",
		"luxon": "^3.1.0",
		"react": "18.1.0",
		"react-datepicker": "^4.8.0",
		"react-dom": "18.1.0",
		"react-dropzone": "^14.2.1",
		"react-hook-form": "^7.31.1",
		"react-i18next": "^11.17.3",
		"react-native": "0.70.5",
		"react-native-gesture-handler": "~2.8.0",
		"react-native-google-places-autocomplete": "^2.4.1",
		"react-native-maps": "1.3.2",
		"react-native-pager-view": "6.0.1",
		"react-native-paper": "^4.0.1",
		"react-native-reanimated": "~2.12.0",
		"react-native-safe-area-context": "4.4.1",
		"react-native-screens": "~3.18.0",
		"react-native-svg": "13.4.0",
		"react-native-tab-view": "^3.1.1",
		"react-router-dom": "^6.2.1",
		"react-select": "^5.3.2",
		"rn-tourguide": "^3.3.0",
		"sentry-expo": "^5.0.3",
		"styled-components": "^5.3.5",
		"victory-area": "^36.0.0",
		"victory-native": "^36.4.1"
	},
	"devDependencies": {
		"@babel/core": "^7.19.3",
		"@expo/config": "^7.0.2",
		"@nrwl/cli": "15.2.0",
		"@nrwl/eslint-plugin-nx": "15.2.0",
		"@nrwl/linter": "15.2.0",
		"@nrwl/expo": "*",
		"@nrwl/react": "15.2.0",
		"@nrwl/web": "15.2.0",
		"@nrwl/workspace": "15.2.0",
		"@sentry/webpack-plugin": "^1.20.0",
		"@svgr/webpack": "^6.3.1",
		"@types/googlemaps": "^3.43.3",
		"@types/lodash": "^4.14.182",
		"@types/luxon": "^2.0.0",
		"@types/node": "16.11.7",
		"@types/react": "~18.0.24",
		"@types/react-datepicker": "^4.4.1",
		"@types/react-dom": "~18.0.8",
		"@types/react-native": "~0.70.6",
		"@types/styled-components": "5.1.26",
		"babel-plugin-styled-components": "1.10.7",
		"babel-preset-expo": "~9.2.1",
		"eas-cli": "^2.7.1",
		"eslint": "~8.15.0",
		"eslint-config-prettier": "^8.5.0",
		"eslint-config-react-app": "^7.0.1",
		"eslint-plugin-react-native": "^4.0.0",
		"metro-resolver": "0.72.3",
		"nx": "15.2.0",
		"prettier": "^2.6.2",
		"typescript": "^4.6.3",
		"webpack-merge": "^5.8.0"
	}
}

And my expo package.json :

{
	"name": "native-app",
	"version": "0.0.1",
	"private": true,
	"dependencies": {
		"dotenv": "*",
		"@expo/config": "*",
		"expo": "*",
		"@expo/metro-config": "*",
		"expo-constants": "*",
		"@amplitude/react-native": "*",
		"lodash": "*",
		"react-native": "*",
		"expo-device": "*",
		"axios": "*",
		"@react-native-async-storage/async-storage": "*",
		"react": "*",
		"@logrocket/react-native": "*",
		"react-native-pager-view": "*",
		"sentry-expo": "*",
		"i18next": "*",
		"expo-dev-client": "*",
		"expo-updates": "*",
		"react-native-safe-area-context": "*",
		"react-native-gesture-handler": "*",
		"react-native-tab-view": "*",
		"intl": "*",
		"intl-pluralrules": "*",
		"expo-splash-screen": "*",
		"expo-notifications": "*",
		"react-native-screens": "*",
		"@react-native-community/netinfo": "*",
		"rn-tourguide": "*",
		"expo-font": "*",
		"expo-asset": "*",
		"react-i18next": "*",
		"react-native-svg": "*",
		"react-hook-form": "*",
		"@react-native-community/datetimepicker": "*",
		"expo-linear-gradient": "*",
		"flagged": "*",
		"react-native-google-places-autocomplete": "*",
		"expo-localization": "*",
		"@react-navigation/elements": "*",
		"react-native-reanimated": "*",
		"@react-native-community/hooks": "*",
		"react-native-maps": "*",
		"@ptomasroos/react-native-multi-slider": "*",
		"@react-navigation/native": "*",
		"@sentry/react-native": "*",
		"react-native-paper": "*",
		"@react-navigation/native-stack": "*",
		"@react-navigation/stack": "*",
		"i18next-http-backend": "*",
		"@react-navigation/bottom-tabs": "*",
		"@react-navigation/drawer": "*",
		"@react-navigation/material-top-tabs": "*",
		"expo-camera": "*",
		"victory-area": "*",
		"victory-native": "*",
		"luxon": "*",
		"@nrwl/expo": "*",
		"@expo/webpack-config": "*",
		"expo-application": "*"
	},
	"scripts": {
		"eas-build-pre-install": "cd ../../ && cp package-lock.json ./apps/native-app/ && echo $GOOGLE_SERVICES_BASE64 | base64 -d > ./apps/native-app/google-services.json",
		"postinstall": "rm -r node_modules && cd ../../ && npm install && npx nx sync-deps native-app && npx nx ensure-symlink native-app"
	}
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting build errors and crashes - Expo Documentation
Go to your build details page (find it on the build dashboard if you don't have it open already) and expand any failed...
Read more >
Android build failed using eas build. · Issue #1101 · expo/eas-cli
I upgraded my expo project to expo 45.0.0 from expo 41.0.0 . While building the project using the command eas build -p android...
Read more >
EAS build failed with error code 1 but Expo Build succeeds, i ...
Please do EAS build if you was doing Expo build. This Error will be solved by doing EAS build as it removes the...
Read more >
Problems building on eas-cli [resolved] - The Draftbit Community
It was mostly building fine on expo-cli but none of my builds on eas-cli have worked. The error for iOS:
Read more >
Expo Eas Local Build Failed : r/reactnative - Reddit
I was giving a chance to expo for the first time today after doing RN bare for ~2 years. Why can't I "npx...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found