Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime not ready]: Error: repack react-native module was not found. Did you forget to update native dependencies?, js engine: hermes #1089

Open
BrunoElias98 opened this issue Mar 14, 2025 · 3 comments
Labels
status:new New issue, not reviewed by the team yet. type:bug A bug report.

Comments

@BrunoElias98
Copy link

BrunoElias98 commented Mar 14, 2025

Describe the bug

I'm facing an issue with Re-Pack on iOS, where the app throws the following error at startup:

Image

However, if I dismiss the error, the app runs normally.

This issue only happens on iOS – on Android, everything works as expected.

Following the webpack.config, i'm using repack 5.0.3

import path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as Repack from '@callstack/repack';
import TerserPlugin from 'terser-webpack-plugin';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

import pkg from './package.json' with { type: 'json' };

/**
 * Webpack configuration enhanced with Re.Pack defaults for React Native.
 *
 * Learn about webpack configuration: https://webpack.js.org/configuration/
 * Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
 */

export default {
  context: __dirname,
  entry: './index.js',
  resolve: {
    ...Repack.getResolveOptions(),
    alias: {
      '@Mocks': path.resolve(__dirname, 'src/@mocks'),
      '@Types': path.resolve(__dirname, 'src/@types'),
      '@Components': path.resolve(__dirname, 'src/components'),
      '@Pages': path.resolve(__dirname, 'src/pages'),
      '@Assets': path.resolve(__dirname, 'src/assets'),
      '@Services': path.resolve(__dirname, 'src/core/services'),
      '@Hooks': path.resolve(__dirname, 'src/core/hooks'),
      '@Store': path.resolve(__dirname, 'src/core/store'),
      '@Constants': path.resolve(__dirname, 'src/core/constants'),
      '@Utils': path.resolve(__dirname, 'src/core/utils'),
    },
  },
  module: {
    rules: [
      {
        test: /\.[cm]?[jt]sx?$/,
        use: 'babel-loader',
        type: 'javascript/auto',
      },
      ...Repack.getAssetTransformRules(),
    ],
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        test: /\.(js)?bundle(\?.*)?$/i,
        extractComments: false,
        terserOptions: {
          format: {
            comments: false,
          },
        },
      }),
    ],
  },
  plugins: [
    new Repack.RepackPlugin(),
    new Repack.plugins.ModuleFederationPluginV2({
      name: 'AppName',
      filename: 'AppName.container.js.bundle',
      exposes: {
        './App': './src/App',
      },
      shared: {
        react: {
          singleton: true,
          eager: true,
          requiredVersion: pkg.dependencies.react,
        },
        'react-native': {
          singleton: true,
          eager: true,
          requiredVersion: pkg.dependencies['react-native'],
        },
      },
    }),
  ],
};

Enabling/disabling Hermes

The error persists even when Hermes is disabled in Podfile.

System Info

System:
  OS: macOS 15.3
  CPU: (10) arm64 Apple M2 Pro
  Memory: 162.22 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/brunoeliasdesouza/.rbenv/shims/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: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.12816248
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Users/brunoeliasdesouza/.sdkman/candidates/java/current/bin/javac
  Ruby:
    version: 3.3.5
    path: /Users/brunoeliasdesouza/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: ^15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.0
    wanted: 0.78.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Re.Pack Version

5.0.3

Reproduction

none

Steps to reproduce

npm i

@BrunoElias98 BrunoElias98 added status:new New issue, not reviewed by the team yet. type:bug A bug report. labels Mar 14, 2025
@jbroma
Copy link
Member

jbroma commented Mar 14, 2025

hi, try reinstalling pods please - if that doesn't work, I can investigate this but you need to provide a valid repository with reproduction because I can't see anything wrong with the config

@BrunoElias98
Copy link
Author

hi, try reinstalling pods please - if that doesn't work, I can investigate this but you need to provide a valid repository with reproduction because I can't see anything wrong with the config

I already tried reinstalling the pods, but unfortunately, the issue persists.

The repository is private since it belongs to the company I work for, so I can't share direct access. However, I can provide specific parts of the configuration or logs if that helps.

Would you be able to guide me on what additional details I can provide to help debug this?

Thanks for your time!

@BrunoElias98
Copy link
Author

@jbroma

I have tried all the suggested solutions, including reinstalling the pods, enabling/disabling Hermes, clearing caches, and ensuring the Webpack configuration is correct. However, the issue still persists on iOS.

After further investigation, I believe this might be caused by an inconsistency with React Native 0.78.0, as everything works fine on Android but fails on iOS with the [runtime not ready] error.

Could this be a compatibility issue between Re.Pack and React Native 0.78.0? Are there any known issues or workarounds for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:new New issue, not reviewed by the team yet. type:bug A bug report.
Projects
None yet
Development

No branches or pull requests

2 participants