expo / expo-pixi

Tools for using pixi.js in Expo
MIT License
304 stars 119 forks source link

Issue when running Signature on Expo Web #147

Open guyzmo opened 3 years ago

guyzmo commented 3 years ago

When running the Signature module, it crashes on the web:

(index):8 Uncaught (in promise) TypeError: Illegal invocation
    at WebGL2RenderingContext.o.default.async.t.getContextAttributes

The issue is thrown from that line:

    const getAttributes = context.getContextAttributes || (() => ({}));

The fix I found was to ignore context.getContextAttributes when running on web:

    const getAttributes = (Platform.OS === 'web') ?
      (() => ({})) :
      context.getContextAttributes || (() => ({}));

It might not be the smartest idea (I have no idea what the context attributes are for), but getting rid of the culprit makes the thing work (up until the next issue).