iOS Debug build fails: use of dynamic_cast requires -frtti (Babylon Native f4d9efb)

Open
#774 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, ios, react-native

Research direction

Start by reading the generated ReactNativeBabylon.xcodeproj Debug configuration and the CMake debug flags described in the issue. Trace how ENABLE_RTTI and NDEBUG affect the XMLHttpRequest.cpp build through napi-inl.h and jsi's Object::getHostObject<T>(). Done means the iOS Debug build compiles without breaking Release builds; the payload gives a workaround but no test or project-generation entry point.

Written by the indexing model from the issue text.

Description

Environment: @babylonjs/react-native 2.0.7 (Babylon Native f4d9efb), React Native 0.81.6 (legacy architecture), Hermes, Xcode 27.1, iOS 27.0 Simulator (iPhone 17), macOS 27.0.1.

Babylon Native now compiles with -fno-rtti (ENABLE_RTTI follows ENABLE_SANITIZERS). The generated
ReactNativeBabylon.xcodeproj Debug configuration has no NDEBUG, so jsi's
Object::getHostObject<T>() keeps assert(isHostObject<T>()), which instantiates std::dynamic_pointer_cast.
XMLHttpRequest.cpp (via napi-inl.h ObjectWrap<T>::Unwrap) then fails to compile. Release builds are fine.

Workaround: regenerate the project with
-DCMAKE_CXX_FLAGS_DEBUG="-g -DNDEBUG" -DCMAKE_OBJCXX_FLAGS_DEBUG="-g -DNDEBUG".

Dominant language
C++
Stars
437
Forks
72
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BabylonJS/BabylonReactNative

All issues in BabylonJS/BabylonReactNative

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.