Failed build EAS (error index.js: Transformer.transform is not a function. TypeError: Transformer.transform is not a function)

warning: the transform cache was reset.
Welcome to Metro!
              Fast - Scalable - Integrated
[stderr] 
error index.js: Transformer.transform is not a function.
TypeError: Transformer.transform is not a function
    at Object.<anonymous> (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:80:38)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:14:24)
    at _next (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:36:9)
    at /home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:43:7
    at new Promise (<anonymous>)
    at Object.<anonymous> (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:32:12)
    at Object._transform (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:98:21)
    at Object.transform (/home/expo/workingdir/build/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/Worker.js:55:21)
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
[stderr] 
FAILURE: Build failed with an exception.
[stderr] 
* What went wrong:
[stderr] 
Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] 
> Process 'command 'node'' finished with non-zero exit value 1
[stderr] 
* Try:
[stderr] 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] 
* Get more help at https://help.gradle.org
[stderr] 
BUILD FAILED in 2m 22s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
53 actionable tasks: 53 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

i got these errors in my “Run gradlew” section, im not sure what caused this?

Before I get into the dependency issues, do you have an android directory in the root of your project?

Based on the dependencies in your project I see a few issues:

$ expo doctor
Some dependencies are incompatible with the installed expo package version:
 - @react-native-community/slider - expected version: 4.1.12 - actual version installed: 4.1.7
 - react-native-get-random-values - expected version: ~1.7.0 - actual version installed: 1.8.0
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]
Warning: https://github.com/expo/react-native/archive/sdk-43.tar.gz is not a valid version. Version must be in the form of sdk-x.y.z. Please update your package.json file.

You should usually do what expo doctor suggests.

$ expo doctor --fix-dependencies
Some dependencies are incompatible with the installed expo package version:
 - @react-native-community/slider - expected version: 4.1.12 - actual version installed: 4.1.7
 - react-native-get-random-values - expected version: ~1.7.0 - actual version installed: 1.8.0
Installing 2 SDK 43.0.0 compatible native modules using Yarn.
> yarn add @react-native-community/slider@4.1.12 react-native-get-random-values@~1.7.0
yarn add v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
success Saved lockfile.
warning Workspaces can only be enabled in private projects.
success Saved 2 new dependencies.
info Direct dependencies
├─ @react-native-community/slider@4.1.12
└─ react-native-get-random-values@1.7.2
info All dependencies
├─ @react-native-community/slider@4.1.12
└─ react-native-get-random-values@1.7.2
Done in 9.31s.
Warning: https://github.com/expo/react-native/archive/sdk-43.tar.gz is not a valid version. Version must be in the form of sdk-x.y.z. Please update your package.json file.

Unfortunately, expo doctor is not clever enough to fix the react-native dependency, but you can just run expo install react-native:

$ expo install react-native
Installing 1 other package using Yarn.
> yarn add react-native@0.64.3
yarn add v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
success Saved lockfile.
warning Workspaces can only be enabled in private projects.
success Saved 1 new dependency.
info Direct dependencies
└─ react-native@0.64.3
info All dependencies
└─ react-native@0.64.3
Done in 5.28s.
$ expo doctor
🎉 Didn't find any issues with the project!

Expo doctor is not perfect, so there could be things it misses. Apparently the Expo Team is working to greatly improve it. One thing that could cause a problem is the fact that you have expo-cli installed as a dependency. Try removing that.

I was able to build an Android app with those dependencies using eas build -p android --profile production.

See if that works for you. If you still have problems, remove your lock file (package-lock.json or yarn.lock) and node_modules and reinstall your dependencies. Then try building again.

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