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

Use of undeclared identifier 'ShadowNodeWrapper'; did you mean 'shadowNodeWrapper'? #3023

Closed
neeteshraj opened this issue Jul 31, 2024 · 4 comments · Fixed by #3024
Closed
Labels
Missing repro Platform: iOS This issue is specific to iOS

Comments

@neeteshraj
Copy link

neeteshraj commented Jul 31, 2024

Description

I have installed 2.18.0 version of react-native-gesture-handler and i am getting this issue while building the ios app in new architecture enabled.

Use of undeclared identifier 'ShadowNodeWrapper'; did you mean 'shadowNodeWrapper'?
Replace 'ShadowNodeWrapper' with 'shadowNodeWrapper'
Variable 'shadowNodeWrapper' declared with deduced type 'auto' cannot appear in its own initializer

the error is pointing here.

#ifdef RCT_NEW_ARCH_ENABLED
void decorateRuntime(jsi::Runtime &runtime)
{
auto isFormsStackingContext = jsi::Function::createFromHostFunction(
runtime,
jsi::PropNameID::forAscii(runtime, "isFormsStackingContext"),
1,
[](jsi::Runtime &runtime, const jsi::Value &thisValue, const jsi::Value *arguments, size_t count) -> jsi::Value {
if (!arguments[0].isObject()) {
return jsi::Value::null();
}

    auto shadowNodeWrapper = arguments[0].asObject(runtime).getNativeState<ShadowNodeWrapper>(runtime);
    bool isFormsStackingContext =
        shadowNodeWrapper->shadowNode->getTraits().check(ShadowNodeTraits::FormsStackingContext);
    return jsi::Value(isFormsStackingContext);
  });

runtime.global().setProperty(runtime, "isFormsStackingContext", std::move(isFormsStackingContext));
}
#endif // RCT_NEW_ARCH_ENABLED.
Screenshot 2024-07-31 at 11 36 55 AM
`

Steps to reproduce

  1. Create a new project
  2. Install 2.18.0 version of react-native-gesture handler

Snack or a link to a repository

private repo

Gesture Handler version

2.18.0

React Native version

0.74.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 15 Pro simulator

Acknowledgements

Yes

Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: iOS This issue is specific to iOS label Jul 31, 2024
@kbeznisko
Copy link

kbeznisko commented Jul 31, 2024

I have the same error, but for android

> Task :react-native-gesture-handler:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: Entering directory `.../node_modules/react-native-gesture-handler/android/.cxx/Debug/595h5z3f/arm64-v8a'
C/C++: /.../Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/.../Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dgesturehandler_EXPORTS -I.../node_modules/react-native/ReactCommon -isystem /.../.gradle/caches/transforms-4/416a9ce8efc944d4162c98e85215c980/transformed/jetified-react-android-0.74.4-debug/prefab/modules/react_render_core/include -isystem /.../.gradle/caches/transforms-4/416a9ce8efc944d4162c98e85215c980/transformed/jetified-react-android-0.74.4-debug/prefab/modules/react_render_uimanager/include -isystem /.../.gradle/caches/transforms-4/416a9ce8efc944d4162c98e85215c980/transformed/jetified-react-android-0.74.4-debug/prefab/modules/react_render_graphics/include -isystem /.../.gradle/caches/transforms-4/416a9ce8efc944d4162c98e85215c980/transformed/jetified-react-android-0.74.4-debug/prefab/modules/jsi/include -isystem /.../.gradle/caches/transforms-4/416a9ce8efc944d4162c98e85215c980/transformed/jetified-react-android-0.74.4-debug/prefab/modules/react_nativemodule_core/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -frtti -fexceptions -Wall -Werror -std=c++20 -DANDROID -fno-limit-debug-info  -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/gesturehandler.dir/cpp-adapter.cpp.o -MF CMakeFiles/gesturehandler.dir/cpp-adapter.cpp.o.d -o CMakeFiles/gesturehandler.dir/cpp-adapter.cpp.o -c /.../node_modules/react-native-gesture-handler/android/src/main/jni/cpp-adapter.cpp
C/C++: /.../node_modules/react-native-gesture-handler/android/src/main/jni/cpp-adapter.cpp:23:59: error: use of undeclared identifier 'ShadowNodeWrapper'; did you mean 'shadowNodeWrapper'?
C/C++:                         .asObject(runtime).getNativeState<ShadowNodeWrapper>(runtime);
C/C++:                                                           ^~~~~~~~~~~~~~~~~
C/C++:                                                           shadowNodeWrapper
C/C++: /.../node_modules/react-native-gesture-handler/android/src/main/jni/cpp-adapter.cpp:22:22: note: 'shadowNodeWrapper' declared here
C/C++:                 auto shadowNodeWrapper = arguments[0]
C/C++:                      ^
C/C++: /.../node_modules/react-native-gesture-handler/android/src/main/jni/cpp-adapter.cpp:23:59: error: variable 'shadowNodeWrapper' declared with deduced type 'auto' cannot appear in its own initializer
C/C++:                         .asObject(runtime).getNativeState<ShadowNodeWrapper>(runtime);
C/C++:                                                           ^
C/C++: 2 errors generated.


@denysoleksiienko
Copy link

same with 2.18.0 version

@m-bert
Copy link
Contributor

m-bert commented Jul 31, 2024

Hi! Thanks for reporting this issue, could you please check if #3024 helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro Platform: iOS This issue is specific to iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants