question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: Can't find variable: SkiaApi In Expo

See original GitHub issue

I tried to use the simple example from here https://shopify.github.io/react-native-skia/docs/paint/overview in react native expo

// code
import {Canvas, Circle, Paint, Group} from "@shopify/react-native-skia";

export default function App() {
    const r = 128;
    return (
        <Canvas style={{ flex: 1 }}>
            <Paint color="lightblue" />
            <Circle cx={r} cy={r} r={r} />
            {/* The paint is inherited by the following sibling and descendants. */}
            <Group style="stroke" strokeWidth={10}>
                <Circle cx={3 * r} cy={3 * r} r={r} />
            </Group>
        </Canvas>
    );
}

i’m getting the following error

ReferenceError: Can't find variable: SkiaApi
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:169518:3 in global code

here is my package.json dependencies

  "dependencies": {
    "@shopify/react-native-skia": "https://github.com/Shopify/react-native-skia/releases/download/v0.1.64-alpha/shopify-react-native-skia-0.1.64.tgz",
    "expo": "~44.0.0",
    "expo-status-bar": "~1.2.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-gesture-handler": "^2.1.1",
    "react-native-reanimated": "^2.3.1",
    "react-native-web": "0.17.1"
  },

Please help and thanks for the great work!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Kudocommented, Jun 8, 2022

in the next version of expo-dev-client with the fix, the problem should be solved. we are still recommending use some alternative way to get the bridge other than RCTBridge.currentBridge because it doesn’t well support multiple bridge

1reaction
wcandilloncommented, Jun 13, 2022

This is fixed part of the latest version of the dev client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - ReferenceError: Can't find variable: require expo
Open your project folder. Manually delete all the node modules. Then reinstall all of them by using the npm install command in your...
Read more >
SplashScreen - Expo Documentation
The SplashScreen module from the expo-splash-screen library is used to tell the splash screen to remain visible until it has been explicitly told...
Read more >
Integrate react-native-skia into managed workflow - Expo
William Candillon presented a very cool react native Skia integration. ... I build with eas build it says "ReferenceError: Can't find variable: SkiaApi"...
Read more >
Expo 46 — What's New and Why it Matters for React Native ...
Expo is a great tool for cross-platform development of React ... brings Skia support with simple APIs to React Native, and Expo 46...
Read more >
[!] CocoaPods could not find compatible versions for pod ...
Answers related to “[!] CocoaPods could not find compatible versions for pod ... null) · react native android ReferenceError: Can't find variable: Intl ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found