Skip to content

warnAboutPodInstall - TypeError: Path must be a string. Received null #797

Closed

Description

@levipro

Environment

System:
OS: macOS 10.15
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 1.40 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.13.0 - ~/.nvm/versions/node/v8.13.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v8.13.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 23.0.1, 26.0.1, 26.0.3, 27.0.3, 28.0.3
System Images: android-26 | Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

Description

I upgraded my project from react native 0.60.4 to 0.61.2 and could not run on iOS

The error reported was:

TypeError: Path must be a string. Received null
    at assertPath (path.js:28:11)
    at Object.basename (path.js:1380:5)
    at Object.keys.map.depName (./node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js:46:41)

I manually changed this:

return dependency ? _path().default.basename(dependency.podspecPath).replace(/\.podspec/, '') : '';

to this:

return dependency && dependency.podspecPath ? _path().default.basename(dependency.podspecPath).replace(/\.podspec/, '') : '';

So now I can run the project again... The offending package was realm which still requires you to run react-native link

Reproducible Demo

This is reproducible with a fresh react-native 0.61.2 project and realm as a dependancy. Then run react-native run-ios

Activity

  1. fnando commented on Oct 16, 2019

    @fnando

    I had the same issue today, when upgrading from react-native v0.60.4 to v0.61.2 and, interestingly, my fix was exactly the same (came here to open an issue).

  2. thymikee commented on Oct 16, 2019

    @thymikee
    Member

    That's a correct fix, can you send a PR? (nvm, sent it already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions