Skip to content

[Bug] [v7] Expo config plugin fails on EAS #4910

@robgraeber

Description

@robgraeber

Expo config plugin fails on EAS

We hit an EAS build failure using react-native-video@7.0.0-beta.9 with Expo.

The specific issue is that the Expo config plugin can fail on EAS when lib/commonjs/expo-plugins/withReactNativeVideo is missing from the installed package.

Environment

expo: ~56.0.8
react-native: 0.85.3
react-native-video: 7.0.0-beta.9
react-native-nitro-modules: ^0.35.9
EAS Build: Android

Config

Our app.json included the config plugin:

{
  "expo": {
    "plugins": ["react-native-video"]
  }
}

Error

During EAS config resolution, the build failed before the native build started:

Failed to read the app config file with `expo config` command:
.../node_modules/expo/bin/cli config --json --full --type public exited with non-zero code: 1

Unable to resolve a valid config plugin for react-native-video.
• main export of react-native-video does not appear to be a config plugin: the following error was thrown when importing .../node_modules/react-native-video/app.plugin.js:

Cannot find module './lib/commonjs/expo-plugins/withReactNativeVideo'
Require stack:
- .../node_modules/react-native-video/app.plugin.js
- .../@expo/config-plugins/build/utils/plugin-resolver.js
...
MODULE_NOT_FOUND

Problem

app.plugin.js requires generated CommonJS output:

module.exports = require('./lib/commonjs/expo-plugins/withReactNativeVideo');

But on the EAS worker, that generated file was not present.

The TypeScript source exists in the package:

src/expo-plugins/withReactNativeVideo.ts

and the published package appears to include built plugin output locally, so this may be install/postinstall related. The package currently has:

"postinstall": "bun run build || exit 0;"

Our suspicion is that under some EAS install conditions, the postinstall/build step can leave the package without the generated lib/commonjs/expo-plugins output while still exiting successfully.

Expected Behavior

"react-native-video" should resolve as a valid Expo config plugin reliably during expo config, especially on EAS.

Actual Behavior

expo config fails because react-native-video/app.plugin.js imports generated CommonJS plugin output that is missing in the installed package.

Workaround

We replaced the app config entry:

"react-native-video"

with a local plugin:

"./plugins/withReactNativeVideo.js"

The local plugin mirrors the upstream Expo plugin behavior but does not import react-native-video/app.plugin.js, avoiding the generated lib/commonjs dependency during Expo config resolution.

We verified the workaround by temporarily removing the local installed file:

node_modules/react-native-video/lib/commonjs/expo-plugins/withReactNativeVideo.js

and rerunning:

expo config --json --full --type public

With the local plugin, config resolution still passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions