Skip to content

React Native MacOS Error: "RNCSlider" was not found in the UIManager #511

@keenan-v1

Description

@keenan-v1

Environment

  • react-native info output:
info Fetching system and libraries information...
System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M2
    Memory: 136.67 MB / 24.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.1.0 - /opt/homebrew/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 9.6.4 - /opt/homebrew/bin/npm
    Watchman: 2023.05.15.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /Users/jonathan/.rvm/rubies/ruby-3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.9971841
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: 18.0.2.1 - /opt/homebrew/opt/openjdk/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.8 => 0.71.8
    react-native-macos: ^0.71.0-0 => 0.71.8
  npmGlobalPackages:
    *react-native*: Not Found
  • are you using the new architecture?
    Not sure, if that's Fabric then I believe that is the default in the latest versions.

  • which version of react & react-native are you using?
    React 18.2.0 & React Native 0.71.8

Description

When adding a <Slider> component to any page and running react-native run-macos results in the error below:

Screenshot of error

Screenshot 2023-05-24 at 19 50 24

Error Log from Metro

LOG  Running "RNCSliderDemo" with {"rootTag":1,"initialProps":{}}
ERROR  Invariant Violation: requireNativeComponent: "RNCSlider" was not found in the UIManager.

This error is located at:
    in RNCSlider (at Slider.tsx:248)
    in SliderComponent (created by App)
    in RCTView (created by View)
    in View (created by App)
    in RCTScrollContentView (at ScrollView.js:1743)
    in RCTScrollView (created by ScrollView)
    in ScrollView (created by ScrollView)
    in ScrollView (created by App)
    in RCTView (created by View)
    in View (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in RNCSliderDemo(RootComponent)
 ERROR  Invariant Violation: requireNativeComponent: "RNCSlider" was not found in the UIManager.

This error is located at:
    in RNCSlider (at Slider.tsx:248)
    in SliderComponent (created by App)
    in RCTView (created by View)
    in View (created by App)
    in RCTScrollContentView (at ScrollView.js:1743)
    in RCTScrollView (created by ScrollView)
    in ScrollView (created by ScrollView)
    in ScrollView (created by App)
    in RCTView (created by View)
    in View (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in RNCSliderDemo(RootComponent)

Reproducible Demo

I've created a repository that has reproduced this issue, though you must run it on a Mac for obvious reasons. https://github.com/keenan-v1/react-native-macos-rnc-slider-demo

The steps I took to create the repository:

  1. npx react-native init RNCSliderDemo --template react-native
  2. cd RNCSliderDemo
  3. yarn install (just in case!)
  4. yarn add @react-native-community/slider
  5. npx react-native-macos-init
  6. Modified App.tsx to have a slider.
  7. yarn react-native run-macos

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions