You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It went pretty smoothly. I am encounter an error though. I am sure it is just some xcode setting or something.
I have the @react-native-clipboard/clipboard (version ^1.14.1) installed. And after the upgrade, when I ran the app, I was getting this error.
WARN `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
WARN `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
I did a few things to diagnose this further. First, I stood up a brand new RN CLI project with the same exact package.json, and I do not get this error. From this point on, I will refer to the existing upgraded project that gets the warning as the old project, and the new one I stood up that doesn't have the error as the new project.
The error is coming from this file, ./node_modules/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.
"use strict";Object.defineProperty(exports,"__esModule",{value: true});exports.removeAllListeners=exports.addListener=void0;varreact_native_1=require("react-native");varClipboardTurboModule=react_native_1.TurboModuleRegistry.getEnforcing('RNCClipboard');exports.default=ClipboardTurboModule;varEVENT_NAME='RNCClipboard_TEXT_CHANGED';vareventEmitter=newreact_native_1.NativeEventEmitter(ClipboardTurboModule);varlistenerCount=eventEmitter.listenerCount;// listenerCount is only available from RN 0.64// Older versions only have `listeners`if(!listenerCount){listenerCount=function(eventType){// @ts-ignorereturneventEmitter.listeners(eventType).length;};}else{listenerCount=eventEmitter.listenerCount.bind(eventEmitter);}varaddListener=function(callback){if(listenerCount(EVENT_NAME)===0){ClipboardTurboModule.setListener();}varres=eventEmitter.addListener(EVENT_NAME,callback);// Path the remove call to also remove the native listener// if we no longer have listeners// @ts-ignoreres._remove=res.remove;res.remove=function(){// @ts-ignorethis._remove();if(listenerCount(EVENT_NAME)===0){ClipboardTurboModule.removeListener();}};returnres;};exports.addListener=addListener;varremoveAllListeners=function(){eventEmitter.removeAllListeners(EVENT_NAME);ClipboardTurboModule.removeListener();};exports.removeAllListeners=removeAllListeners;
I added a console.log(ClipboardTurboModule) under line 5 and found on the new project, I get this
You can immediately see that the old project is missing addListener and removeListeners which are now required for NativeEventEmitter. So my next goal was to find where this ClipboardTurboModule object comes from and I think I found it. I believe it is from here, ./ios/Pods/Headers/Private/React-Codegen/rnclipboard/rnclipboard.h. The new project, this file exists but in the old one it doesn't. In fact, many of the codegen files here don't exist.
IDK how to turn this on. The Podfile's for both are pretty much identical (differing for only some firebase stuff). I went through a ton of the build settings and build phases and they seem to be the same. Removing node modules, build, and pods folders and pnpm-lock.yaml and Podfile.lock files and re-running/installing/building everything doesn't help.
Also, this seems to be an iOS issue only.
Any ideas? TIA
Steps to reproduce
I cannot reproduce this on a new project.
Affected Platforms
Runtime - iOS
Output of npx react-native info
warn Package rn-fetch-blob contains invalid configuration: "dependency.hooks" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
OS: macOS 14.5
CPU: (14) arm64 Apple M3 Max
Memory: 200.31 MB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.13.1
path: ~/.volta/tools/image/node/20.13.1/bin/node
Yarn: Not Found
npm:
version: 10.5.2
path: ~/.volta/tools/image/node/20.13.1/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK: Not Found
IDEs:
Android Studio: 2023.2 AI-232.10227.8.2321.11479570
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.74.1
wanted: ^0.74.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Old Version
0.71.10
New Version
0.74.1
Description
Hello,
I Just followed the steps over at the React Native Upgrade Helper for my specific verson..
It went pretty smoothly. I am encounter an error though. I am sure it is just some xcode setting or something.
I have the @react-native-clipboard/clipboard (version ^1.14.1) installed. And after the upgrade, when I ran the app, I was getting this error.
I did a few things to diagnose this further. First, I stood up a brand new RN CLI project with the same exact package.json, and I do not get this error. From this point on, I will refer to the existing upgraded project that gets the warning as the old project, and the new one I stood up that doesn't have the error as the new project.
The error is coming from this file,
./node_modules/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js
.I added a
console.log(ClipboardTurboModule)
under line 5 and found on the new project, I get thisAnd the old one I get this.
You can immediately see that the old project is missing
addListener
andremoveListeners
which are now required forNativeEventEmitter
. So my next goal was to find where thisClipboardTurboModule
object comes from and I think I found it. I believe it is from here,./ios/Pods/Headers/Private/React-Codegen/rnclipboard/rnclipboard.h
. The new project, this file exists but in the old one it doesn't. In fact, many of the codegen files here don't exist.IDK how to turn this on. The Podfile's for both are pretty much identical (differing for only some firebase stuff). I went through a ton of the build settings and build phases and they seem to be the same. Removing
node modules
,build
, andpods
folders andpnpm-lock.yaml
andPodfile.lock
files and re-running/installing/building everything doesn't help.Also, this seems to be an iOS issue only.
Any ideas? TIA
Steps to reproduce
I cannot reproduce this on a new project.
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: