expo: Expo 47: `console.log` in `app.config.ts` crashes build in `expo-updates/scripts/createManifest.js`
Summary
Adding a console.log inside app.config.ts will have expo-updates/scripts/createManifest.js interpret that console output as part of the entryFile file name - crashing the whole eas build.
I detected this by replacing this error: https://github.com/expo/expo/blob/78cca68c09c345e35634d9353cb2a9c4bc854c30/packages/expo-updates/scripts/createManifest.js#L37 with
'Error loading application entry point ' + entryFile + ' relative to ' + possibleProjectRoot + ' or ' + possibleProjectRoot + '/..'
which then resulted in the error message
[RUN_GRADLEW] Error loading application entry point configured app for {
[RUN_GRADLEW] bundleIdentifier: 'xxx',
[RUN_GRADLEW] extra: {
[RUN_GRADLEW] apiDomain: 'https://xxx.dev',
[RUN_GRADLEW] eas: { projectId: 'xxx' }
[RUN_GRADLEW] }
[RUN_GRADLEW] }
[RUN_GRADLEW] index.js relative to /tmp/circleci/eas-build-local-nodejs/16db90bf-ef45-4ddd-8d07-3f6958b1aa87/build/apps/web4/android or /tmp/circleci/eas-build-local-nodejs/16db90bf-ef45-4ddd-8d07-3f6958b1aa87/build/apps/web4/android/..
We were logging those values ({ bundleIdentifier, extra }) to see if all environment variables are handled correctly in all builds, since there are some slight differences between normal EAS builds and EAS update builds - and it helped us a ton debugging those. Unfortunately, it also breaks builds now.
SDK Version
47
This did not happen in SDK 46.
Environment
expo-env-info 1.0.5 environment info: System: OS: Linux 5.18 Debian GNU/Linux 10 (buster) 10 (buster) Shell: 5.0.3 - /bin/bash Binaries: Node: 16.18.0 - /usr/bin/node Yarn: 3.2.1 - /usr/local/bin/yarn npm: 6.14.14 - /usr/local/bin/npm SDKs: Android SDK: API Levels: 28, 30, 31 Build Tools: 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2, 30.0.3, 31.0.0 Expo Workflow: bare
Minimal reproducible example
Just add a console.log("something") to the configuration file of any working expo project and try to EAS build it.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 21 (6 by maintainers)
@igorcesarcode this is not related. Your fast refresh is breaking because Metro thinks the project is running in CI (presumably because
process.env.BUILD_NUMBERis defined (maybe other reasons too)). I merged https://github.com/facebook/metro/pull/889 so we can implement a warning in Expo CLI which tells you why fast refresh was disabled.@igorcesarcode you can use
BUILD_NUMBERin SDK 48, onlyCI=1disables fast refresh – when this happens there’s a warning.Thank you. This post saved me lots of time. Removing the console.log fixed the issue. Regards.
@garrettg123 I read the source code of pretty much every involved package and and finally found the error message (see initial post) and started modifying that until I got the information I needed. Detective work 😅
I’m seeing this too and commenting out
console.logs fixes it. I’m wondering, @phryneas, how did you figure out it was the console logs??! Still broken on47.0.6.