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

ReferenceError: SkiaViewApi is not defined in React Native Web w/ react-native-skia 1.8.0 #2914

Open
1 task
Bartozzz opened this issue Jan 25, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Bartozzz
Copy link

Description

I am making an Expo application meant to work on iOS, Android, and the Web. I tried bumping react-native-skia to the latest version to leverage the new sampling property, but when running the application on the web, it throws:

ReferenceError: SkiaViewApi is not defined

After further investigation, I've noticed that this pull-requests causes the error, especially: https://github.com/Shopify/react-native-skia/pull/2854/files#diff-628ba71b9ce2651cb45c9b0db8670f682532fe11fff3bb7b483b1f6b82dac43cR106. It looks like it tries to call a method on a global object (SkiaViewApi) but this object is not defined in the Expo Web environment.

For now I'll roll back to "@shopify/react-native-skia": "1.5.0" as it is the recommended compatible version by Expo, but just wanted to let you know that releases >=1.8.0 seem to not be compatible with Expo Web/React Native for web.

React Native Skia Version

1.8.0

React Native Version

0.76.6

Using New Architecture

  • Enabled

Steps to Reproduce

  • Create a clean Expo project with web support
  • Add Skia using the official documentation
  • Run the project

Snack, Code Example, Screenshot, or Link to Repository

.

@Bartozzz Bartozzz added the bug Something isn't working label Jan 25, 2025
@Bartozzz Bartozzz changed the title ReferenceError: SkiaViewApi is not defined ReferenceError: SkiaViewApi is not defined in React Native Web w/ react-native-skia 1.8.0 Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant