Skip to content

app.plugin.js missing at package root in v2 RC, expo prebuild fails with plugin resolution error #159

@tan5166

Description

@tan5166

Library Version

@use-voltra/ios-client@2.0.0-rc.2 / @use-voltra/android-client@2.0.0-rc.2

React Native Version

0.85.3

React Version

19.2.3

Expo Version

56.0.5

Minimal Reproduction

No dedicated repo needed, reproducible with a fresh Expo project:

Steps:

  1. Create a new Expo project:

    npx create-expo-app my-app
    cd my-app
  2. Install Voltra v2 RC:

    npm install @use-voltra/ios-client@2.0.0-rc.2 @use-voltra/android-client@2.0.0-rc.2
  3. Add the plugins to app.json:

    {
      "expo": {
        "plugins": [
          ["@use-voltra/ios-client", { "widgets": [] }],
          ["@use-voltra/android-client", { "widgets": [] }]
        ]
      }
    }
  4. Run prebuild:

    npx expo prebuild --clean

Result:

No "app.plugin.{js,cjs,mjs,ts,cts,mts}" file was found in "@use-voltra/ios-client",
loaded the package's main entry instead.

PluginError: Cannot find module '../native/VoltraRNNativeComponent'
Require stack:
  - node_modules/@use-voltra/ios-client/build/commonjs/components/VoltraView.js
  - node_modules/@use-voltra/ios-client/build/commonjs/components/VoltraLiveActivityPreview.js
  - node_modules/@use-voltra/ios-client/build/commonjs/index.js
  ...

Root Cause
Expo's plugin resolver uses resolveFrom (filesystem-based), which does not consult package.json exports map. Since no physical app.plugin.js exists at the package root of either -client package, the fallback to main entry triggers the crash.

Additional Information (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions