Skip to content

pod install fails with "multiple dependencies with different sources for VoltraWidget" (pnpm) #79

@CavalcanteLeo

Description

@CavalcanteLeo

Library Version

1.2.0

React Native Version

0.81.6

React Version

19.1.0

Expo Version

54.0.33

Minimal Reproduction

Steps to reproduce

  1. Create an Expo 54 app with React Native 0.81 and add voltra (e.g. ^1.2.0).
  2. Configure the Voltra plugin in app.config.ts with a widget (e.g. bookmarks) and run npx expo prebuild --platform ios so the LINESLiveActivity target and Podfile block are generated.
  3. Use pnpm as the package manager (so node_modules/voltra is a symlink into .pnpm).
  4. Run cd ios && pod install.

Expected behavior

pod install completes and the Live Activity target links against a single VoltraWidget pod source.

Actual behavior

pod install fails with:

[!] There are multiple dependencies with different sources for `VoltraWidget` in `Podfile`:

- VoltraWidget (from `../node_modules/.pnpm/voltra@1.2.0_.../node_modules/voltra/ios`)
- VoltraWidget (from `../node_modules/voltra/ios`)

CocoaPods sees two paths for the same pod because pnpm uses a symlink for node_modules/voltra. If that duplicate is not resolved, the iOS build can also fail with:

error: Unable to find module dependency: 'VoltraWidget'
  import VoltraWidget

(in the Live Activity target that uses VoltraWidgetBundle.swift).


Details

  • Package manager: pnpm (symlinked node_modules)
  • Platform: iOS

The Voltra plugin adds a single pod 'VoltraWidget', :path => podspec_dir_path in the widget extension target. The path is derived from node_modules/voltra/ios; with pnpm that can be resolved as both the symlink path and the real path, so CocoaPods treats them as two different sources.

Suggested fix: In the plugin’s Podfile generation (e.g. plugin/build/ios-widget/podfile.js), canonicalize the path before building the relative path, e.g. in Ruby:

podspec_dir_path = File.realpath(podspec_dir_path) if podspec_dir_path && File.exist?(podspec_dir_path)

before:

podspec_dir_path = Pathname.new(podspec_dir_path).relative_path_from(Pathname.new(__dir__)).to_path

Workaround: An Expo config plugin that runs withPodfile and inserts the File.realpath line into the Voltra-generated block so the generated Podfile uses a single canonical path (e.g. plugins/withVoltraWidgetPodPathFix.js applied after the voltra plugin in app.config.ts).

Additional Information (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions