Skip to content

createBundleReleaseJsAndAssets FAILED #54423

Closed as not planned
Closed as not planned

Description

@sahinboga

Description

I suddenly got this error while building my project. I used it for 2 weeks and there was no problem. I didn't understand.

Steps to reproduce

  1. install application "cd android && ./gradlew bundleRelease"

React Native Version

0.81.4

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.4.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 131.30 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.19.4
    path: /Users/sahinboga/.nvm/versions/node/v20.19.4/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /Users/sahinboga/.nvm/versions/node/v20.19.4/bin/npm
  Watchman:
    version: 2025.05.19.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/sahinboga/.gems/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "25"
      - "26"
      - "28"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.9787799
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.4.4
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: 0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

> Task :app:createBundleReleaseJsAndAssets FAILED
error configs.toReversed is not a function.
TypeError: configs.toReversed is not a function
    at mergeConfig (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/metro-config/src/loadConfig.js:179:35)
    at Object.getDefaultConfig (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/@react-native/metro-config/dist/index.js:97:39)
    at loadMetroConfig (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/@react-native/community-cli-plugin/dist/utils/loadMetroConfig.js:66:39)
    at Object.buildBundle [as func] (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/@react-native/community-cli-plugin/dist/commands/bundle/buildBundle.js:22:53)
    at Command.handleAction (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/@react-native-community/cli/build/index.js:139:23)
    at Command.listener [as _actionHandler] (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/commander/lib/command.js:482:17)
    at /Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/commander/lib/command.js:1283:27)
    at /Users/sahinboga/Documents/GitHub/YayincilikOgretmen/node_modules/commander/lib/command.js:1081:27

MANDATORY Reproducer

https://github.com/sahinboga

Screenshots and Videos

No response

Activity

  1. react-native-bot commented on Nov 6, 2025

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. jsite-pl commented on Nov 6, 2025

    @jsite-pl

    I had the same error today. I needed to sync my project with Gradle files in Android Studio. I encountered some errors, but after fixing them, I simply ran a "clean project" in Android Studio and synced the project with Gradle files again. After that, everything worked fine.

  3. sahinboga commented on Nov 7, 2025

    @sahinboga
    Author

    I think it was a temporary issue, when I tried it a few hours later I was able to get the correct build.

  4. taylorkline commented on Nov 7, 2025

    @taylorkline

    For me, the issue occurred because I still had an .xcode.env.local that pointed to an old version of Node.

  5. JengYoung commented on Nov 12, 2025

    @JengYoung

    In my case, I was using nvm(which automatically switches Node versions in each workspace), and my Node version was lower than the one that supports ES2023 (available in Node v20 and above).

    So, I updated the default Node version in nvm to v22.

  6. trehman82 commented on Nov 24, 2025

    @trehman82

    I got this error, solved by changing the node version to 20.16.0. Issue resolved.

  7. andrishop commented on Nov 28, 2025

    @andrishop

    the same problem here, in Apple M4, only macos...

  8. francoangulo commented on Dec 9, 2025

    @francoangulo

    I was having the same issue and in my case it was also due to Node versions, I had to upgrade it

  9. 4 remaining items

  10. aliceni81 commented on Dec 16, 2025

    @aliceni81

    I have the same error, but the error is

    Task :app:createBundleReleaseJsAndAssets FAILED
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem was found with the configuration of task ':app:createBundleReleaseJsAndAssets' (type 'BundleHermesCTask').
      - In plugin 'com.facebook.react' type 'com.facebook.react.tasks.BundleHermesCTask' property 'cliFile' file '/Users/williamchan/Documents/gk_research_app_staging/android/app' is not a file.
        
        Reason: Expected an input to be a file but it was a directory.
        
        Possible solutions:
          1. Use a file as an input.
          2. Declare the input as a directory instead.
        
        For more information, please refer to https://docs.gradle.org/8.14.3/userguide/validation_problems.html#unexpected_input_file_type in the Gradle documentation.
    
    * Try:
    > Use a file as an input
    > Declare the input as a directory instead
    > Run with --scan to get full insights.
    

    Do anybody have idea about it?

    I think this must be related to cliFile path in your android -> app -> build.gradle Either completely remove that reference or change it to node_modules/react-native/cli.js

    Hopefully it would solve your bug

    You really saved my day!!!
    I realized that @expo/cli is missing (as I use expo). After installing it, the problem is fixed.

    // Added by install-expo-modules
        entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
        cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
        bundleCommand = "export:embed"
    
  11. DeepakSharma04 commented on Dec 16, 2025

    @DeepakSharma04

    After updated the node to v20.19.6 and restart the mac it works

  12. camboYY commented on Dec 25, 2025

    @camboYY

    node -v
    v20.19.4
    not working

  13. alishah514 commented on Dec 25, 2025

    @alishah514

    node -v v20.19.4 not working

    Can you show me your .xcode.env.local file?? Inside iOS folder..

  14. camboYY commented on Dec 26, 2025

    @camboYY

    node -v v20.19.4 not working

    Can you show me your .xcode.env.local file?? Inside iOS folder..

    export NODE_BINARY=$(command -v node)

  15. Timjini commented on Jan 2, 2026

    @Timjini

    Hi, I had the same error in my case it was the Node version I changed from 18 to 22 and it worked.

  16. range-of-motion commented on Jan 10, 2026

    @range-of-motion

    Hi, I had the same error in my case it was the Node version I changed from 18 to 22 and it worked.

    Worked for me, thanks! 🙌

  17. obayit commented on Jan 14, 2026

    @obayit

    expo/expo#42057
    probably, you need to upgrade node version

  18. eakarpov commented on Jan 28, 2026

    @eakarpov

    @DeepakSharma04 restarting mac was the key, thanks!

  19. Abhishek-ks-19 commented on Mar 7, 2026

    @Abhishek-ks-19

    I had the same issue. I was using nvm, and it was defaulting to an older Node version. So every time a new terminal started for Metro, it used the older version. I fixed it by setting the default Node version in nvm to v20.

  20. react-native-bot commented on Sep 4, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  21. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 4, 2026
  22. react-native-bot commented on Sep 11, 2026

    @react-native-bot
    Collaborator

    This issue was closed because it has been stalled for 7 days with no activity.

  23. removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.📦Bundler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions