Skip to content

React Native Skia on Web - Unable to load with multiple tabs open at once #3505

@cubevis

Description

@cubevis

Description

Using WithSkiaWeb, having more then one tab opened at once, fallback attribute will trigger

I've also checked that canvaskit.wasm is correctly fetching in duplicated tab, so I guess it's just issue with WithSkiaWeb

React Native Skia Version

2.2.12

React Native Version

0.81.4

Using New Architecture

  • Enabled

Steps to Reproduce

  1. Use WithSkiaWeb
import '@expo/metro-runtime'
import { WithSkiaWeb } from '@shopify/react-native-skia/lib/module/web';
import { fontsConfig } from './fontsConfig';
import { useFonts } from 'expo-font';
import UILoaderText from './components/UI/UILoaderText';


export default function App() {

  let location = window.location.origin

  /* -------------------------- 2. Load Project Font -------------------------- */
  const [fontsLoaded] = useFonts(fontsConfig);
  if (!fontsLoaded) return <UILoaderText text='Fonts' />;
  /* -------------------------------------------------------------------------- */


  return (
    <WithSkiaWeb
      getComponent={() => import("./AppCore")}
      opts={{
        locateFile: (file) => `${location}/${file}?v=${Date.now()}`
      }}
      fallback={<UILoaderText text='Loading skia web...' />}
    />
  );
}
  1. Duplicate Tab in browser
  2. Unable to pass Loading skia web

Snack, Code Example, Screenshot, or Link to Repository

import '@expo/metro-runtime'
import { WithSkiaWeb } from '@shopify/react-native-skia/lib/module/web';
import { fontsConfig } from './fontsConfig';
import { useFonts } from 'expo-font';
import UILoaderText from './components/UI/UILoaderText';


export default function App() {

  let location = window.location.origin

  /* -------------------------- 2. Load Project Font -------------------------- */
  const [fontsLoaded] = useFonts(fontsConfig);
  if (!fontsLoaded) return <UILoaderText text='Fonts' />;
  /* -------------------------------------------------------------------------- */


  return (
    <WithSkiaWeb
      getComponent={() => import("./AppCore")}
      opts={{
        locateFile: (file) => `${location}/${file}?v=${Date.now()}`
      }}
      fallback={<UILoaderText text='Loading skia web...' />}
    />
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions