Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Issue with PIXI filters evaluating undefined.__filters #13

Closed
ianmcgregor opened this issue Mar 19, 2018 · 3 comments
Closed

Issue with PIXI filters evaluating undefined.__filters #13

ianmcgregor opened this issue Mar 19, 2018 · 3 comments
Assignees

Comments

@ianmcgregor
Copy link

On iOS my app is blowing up on this line in the PIXI filters package:

Object.assign(PIXI.filters, this.__filters);

The author is obviously expecting this to resolve to window or global, but in React Native it appears to be undefined.

Commenting put the lines that import pixi-filters fixes the issue:

import * as filters from 'pixi-filters';
PIXI.filters = { ...(PIXI.filters || {}), ...filters };

Anyone know a workaround for 'this'?

img_1453

@EvanBacon EvanBacon self-assigned this Apr 1, 2018
@EvanBacon
Copy link
Contributor

I don't quite understand the problem, is your app crashing at this:

PIXI.filters = { ...(PIXI.filters || {}), ...filters };
?

@ianmcgregor
Copy link
Author

Hi @EvanBacon it's actually in the filters package itself, which is imported as a bundle (pixi-filters.cjs.js).

In there it creates a global variable '__filters' and tries to assign PIXI.filters to it.

I worked around it by importing Expo.GLView and PIXI separately (using what I learned from this repo - thanks!)

I will set up a new project with a bare bones crna + expo-pixi to see if it still breaks, in case it was something else I was doing that caused this.

@EvanBacon
Copy link
Contributor

Closing for now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants