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

Example app not able to resolve the library present in the parent directory #590 #591

Closed
2 tasks done
GuptaAman08 opened this issue Jul 17, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@GuptaAman08
Copy link

GuptaAman08 commented Jul 17, 2024

Description

HI folks,

I just upgraded my example app as per the link.
Gradle build worked fine but when the build gets launched in the emulator it fails with the below error.

error: Error: Unable to resolve module @deliverysolutions/react-native-proximity-sdk from /Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/src/App.js: @deliverysolutions/react-native-proximity-sdk could not be found within the project or in these directories:
  node_modules
  ../node_modules
  12 | import { UpdateETAScreen } from './screens/UpdateETA';
  13 | import { UpdateVehicleDetailsScreen } from './screens/UpdateVehicleDetails';
> 14 | import Proximity from '@deliverysolutions/react-native-proximity-sdk';
     |                        ^
  15 | import FlashMessage from "react-native-flash-message";
  16 | const Stack = createNativeStackNavigator();
  17 |
    at ModuleResolver.resolveDependency (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:138:15)
    at DependencyGraph.resolveDependency (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at /Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/lib/transformHelpers.js:156:21
    at resolveDependencies (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/DeltaBundler/buildSubgraph.js:42:25)
    at visit (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/DeltaBundler/buildSubgraph.js:83:30)
    at async Promise.all (index 2)
    at async visit (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/DeltaBundler/buildSubgraph.js:92:5)
    at async Promise.all (index 0)
    at async buildSubgraph (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/DeltaBundler/buildSubgraph.js:103:3)
    at async Graph._buildDelta (/Users/rajivkulkarni/Desktop/proximity-apps/new_proximity_rn_sdk/proximity-sdk-react-native/example/node_modules/metro/src/DeltaBundler/Graph.js:157:22)

For some reason, I am not able to figure out why suddenly the linking is failing.

Things i tried

  • I read this official article link, and got to know that bable.config.js, metro.config.js and react-native.config.js are the key in resolving the dependency
  • Also, i tried reverting changes for these three files but no luck

Can anyone please help me understand where am going wrong.

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

No options. Just ran npm prepack = bob build

Link to repro

Its not public

Environment

Running command npx react-native info in Library folder provides the below detail

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 87.31 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: Not Found
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
    Watchman: 2024.07.01.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
    Android SDK:
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2023.2 AI-232.10300.40.2321.11668458
    Xcode: 15.4/15F31d - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.4 => 0.71.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Running command npx react-native info in Example app folder provides the below details

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 121.95 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.0
    path: ~/.nvm/versions/node/v18.16.0/bin/node
  Yarn: Not Found
  npm:
    version: 9.5.1
    path: ~/.nvm/versions/node/v18.16.0/bin/npm
  Watchman:
    version: 2024.07.01.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/rajivkulkarni/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.0
    wanted: 0.73.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
@GuptaAman08 GuptaAman08 added the bug Something isn't working label Jul 17, 2024
@atlj
Copy link
Collaborator

atlj commented Jul 17, 2024

Hey, this looks more like a discussion since you've modified the generated library a lot and cannot provide a repro. Closing this in favor of #590.

@atlj atlj closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants