Skip to content

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Sep 25, 2025

Summary

Fixes #8285.

When initializing "PlatformChecker" in lazy import environments globalThis.__RUNTIME_KIND will be executed before it's defined in runtimeKind file. By changing it to function invocation we enforce that it's properly initialized.

Also setting serialized values manually for runOnUI and runOnUIAsync has to be done only when not in web implementation.

Test plan

See fixed issue.

@tjzel tjzel added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit c4d2e07 Sep 30, 2025
13 checks passed
@tjzel tjzel deleted the @tjzel/worklets/fix-init branch September 30, 2025 09:26
tjzel added a commit that referenced this pull request Oct 9, 2025
## Summary

Fixes #8285.

When initializing "PlatformChecker" in lazy import environments
`globalThis.__RUNTIME_KIND` will be executed before it's defined in
`runtimeKind` file. By changing it to function invocation we enforce
that it's properly initialized.

Also setting serialized values manually for `runOnUI` and `runOnUIAsync`
has to be done only when not in web implementation.

## Test plan

See fixed issue.
tjzel added a commit that referenced this pull request Oct 9, 2025
## Summary

Fixes #8285.

When initializing "PlatformChecker" in lazy import environments
`globalThis.__RUNTIME_KIND` will be executed before it's defined in
`runtimeKind` file. By changing it to function invocation we enforce
that it's properly initialized.

Also setting serialized values manually for `runOnUI` and `runOnUIAsync`
has to be done only when not in web implementation.

## Test plan

See fixed issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expo 54, React Native Web - WorkletsError: createSerializableObject should never be called in JSWorklets

2 participants