Error reading Expo config on EAS build when upgrading from Expo 47 to 49

I’m upgrading our Expo app from SDK 47 to 49. Got everything working locally, but when I do an EAS build, both Android and iOS builds are failing with this error:

Error: Error reading Expo config at /home/expo/workingdir/build/mobile/app.config.js:

We are in a mono repo, and I suspect the problem is something related to that. I suspect this because the end of that path says “mobile/app.config.js” and our mobile app is on the “mobile” subdirectory of our mono repo.

Any ideas what may have changed from 47 to 49, and what I need to do to point to the correct path for app.config.js?

We are on the managed workflow.

eas --version shows: eas-cli/4.1.2 darwin-arm64 node-v16.13.0

For any Expo people, here are my build links:

I’ve found and fixed the problem.

It was actually an error that bubbled up from some code we had in app.config.js that reads a file from the repo to get the version number.

I changed our code from this:

const VERSION = JSON.parse(fs.readFileSync(process.cwd() + '/version_info.json').toString());

to this

const VERSION = JSON.parse(fs.readFileSync(__dirname + '/version_info.json').toString());

Basically, it seems that the current working directory in EAS changed and is no longer the root of the project. Changingn this to __dirname fixed the problem.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.