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

App crashes when debugging JS remotely with react-native-skia #850

Closed
Jorundur opened this issue Aug 25, 2022 · 0 comments · Fixed by #853
Closed

App crashes when debugging JS remotely with react-native-skia #850

Jorundur opened this issue Aug 25, 2022 · 0 comments · Fixed by #853
Labels
bug Something isn't working

Comments

@Jorundur
Copy link

Jorundur commented Aug 25, 2022

Description

If I have react-native-skia installed and use it anywhere in my Expo app, then it works fine as long as I don't debug JS remotely, but if I do it blows up immediately with the errors shown below. This means that e.g. the react-native-debugger can not be used with projects using react-native-skia.

Version

0.1.141

Steps to reproduce

Create a new Expo project:

npx create-expo-app my-app

Install react-native-skia:

npx expo install @shopify/react-native-skia

Currently creates a project with the following package.json:

{
  "name": "my-app",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~46.0.9",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-native": "0.69.4",
    "@shopify/react-native-skia": "0.1.141"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

Change App.js to the following:

import { Canvas, Path } from "@shopify/react-native-skia";
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>
      <StatusBar style="auto" />
      <Canvas style={{ height: 400, width: 400 }}>
        <Path
          path="M 128 0 L 168 80 L 256 93 L 192 155 L 207 244 L 128 202 L 49 244 L 64 155 L 0 93 L 88 80 L 128 0 Z"
          color="lightblue"
        />
      </Canvas>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});

Run app. It works fine when not debugging JS remotely, but blows up right away when debugging JS remotely. You can debug JS remotely by shaking the device to bring up the developer menu in Expo and press "Debug JS remotely".

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

See "Steps to reproduce" above.

@Jorundur Jorundur added the bug Something isn't working label Aug 25, 2022
@Jorundur Jorundur changed the title App crashes when debugging JS remotily with react-native-skia App crashes when debugging JS remotely with react-native-skia Aug 25, 2022
wcandillon added a commit that referenced this issue Aug 26, 2022
wcandillon added a commit that referenced this issue Aug 26, 2022
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

Successfully merging a pull request may close this issue.

1 participant