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

Issue with Text on web in Expo 48 #1844

Open
onlyanegg opened this issue Sep 15, 2023 · 2 comments
Open

Issue with Text on web in Expo 48 #1844

onlyanegg opened this issue Sep 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@onlyanegg
Copy link

Description

I'm having trouble using the Text component on web in Expo 48. It's working in Expo 49

Host.ts:38 Uncaught TypeError: Cannot read properties of null (reading 'ref')
    at JsiSkFont.fromValue (Host.ts:38:1)
    at JsiSkCanvas.drawText (JsiSkCanvas.ts:260:1)
    at TextNode.draw (Text.ts:25:1)
    at TextNode.renderNode (DrawingNode.ts:58:1)
    at TextNode.render (RenderNode.ts:254:1)
    at GroupNode.ts:15:1
    at Array.map (<anonymous>)
    at GroupNode.renderNode (GroupNode.ts:13:1)
    at GroupNode.render (RenderNode.ts:254:1)
    at SkiaDomView.renderInCanvas (SkiaDomView.web.tsx:33:1)

Version

0.1.172

Steps to reproduce

# Create expo app
yarn create expo-app skia-expo48
cd skia-expo48/

# Downgrade to Expo 48
yarn add expo@^48.0.0
npx expo-doctor
yarn expo install expo-status-bar react-native

# Add expo web support
yarn expo install react-dom react-native-web @expo/webpack-config

# Install rn-skia and rn-reanimated
yarn expo install @shopify/react-native-skia react-native-reanimated

# Add postinstall script to setup skia web and add fs, path, and os to canvaskit-wasm
#   "yarn setup-skia-web && node postinstall.js"
vim package.json

# Add test files
cp ../skia/postinstall.js .
cp ../skia/App.js .
cp ../skia/Skia.js .
cp ../skia/Freedom.ttf .

# Install, postinstall, and start web
yarn
yarn web

Snack, code example, screenshot, or link to a repository

https://github.com/onlyanegg/rn-skia-issue

@onlyanegg onlyanegg added the bug Something isn't working label Sep 15, 2023
@wcandillon
Copy link
Collaborator

Silly question, if it works on SDK 49, (with the same version than on SDK 48?) shouldn't we leave it at that?

@onlyanegg
Copy link
Author

with the same version than on SDK 48?

Not the same version actually. I used the expo-recommended version via yarn expo install @shopify/react-native-skia which was a later version. I guess I could try ignoring the recommended version in favor of a later version.

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

2 participants