Skip to content

[worklets][bundle mode] Error: getPropertyAsObject: property '__reportFatalRemoteError' is undefined #8904

@hannojg

Description

@hannojg

Description

When using the new bundle mode in a fresh expo project you get the following error on app start:

Caused by: com.facebook.react.common.JavascriptException: [runtime not ready]: Error: Exception in HostFunction: getPropertyAsObject: property '__reportFatalRemoteError' is undefined, expected an Object

Error: getPropertyAsObject: property '__reportFatalRemoteError' is undefined, expected an Object
    at installTurboModule (native)
    at NativeWorklets (http://127.0.0.1:8081/index.ts.b...

I debugged this, and the reason seems to be that expo ships its metro config with inline requires disabled.
Due to that, when trying to load the bundle into the ui runtime here:

i assume that we try to import too much stuff in the wrong order, breaking expectations of worklets bundle mode (or something like that).

The workaround is to enable inline requires, however, this got me thinking if in the bundleModeMetroConfig we should enable that option, or somehow add a check if this option is disabled and throw an explicit error?

Steps to reproduce

  1. Setup a blank expo app
  2. Enable bundle mode
  3. try to call a worklet function in App.tsx

Alternatively, I assume in the showcase app, you can try setting inlineRequires to false and i assume it would crash as well

Snack or a link to a repository

I am so sorry, i didn't have time yet to create one.

Reanimated version

4.2.1

Worklets version

0.8.0-bundle-mode-preview-1

React Native version

0.83.1

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

New Architecture (Fabric renderer)

Reanimated feature flags

No

React Native release level

Stable

Build type

Debug app & dev bundle

Device

Real device

Host machine

macOS

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions