trych Posted January 8, 2023 Share Posted January 8, 2023 Hi there, I have a small pixi.js setup where I apply a Pixelate filter. I am now trying to upgrade this to PIXI v7.x, but get an error that I don't understand. Here is the line that gives me the issue: const pixelateFilter = new PIXI.filters.PixelateFilter(1); I get this error: Uncaught TypeError: Class constructor Mt cannot be invoked without 'new' at new n (PixelateFilter.ts:25:9) at (Index):20:30 I have no idea what to do and the v7 Breaking changes section on GitHub does not seem to mention filters either. How do I need to change the syntax to make it work in PIXI v7.x ? Thanks! Quote Link to comment Share on other sites More sharing options...
KreNtal Posted January 9, 2023 Share Posted January 9, 2023 Did you import it before using? https://www.npmjs.com/package/@pixi/filter-pixelate Quote Link to comment Share on other sites More sharing options...
trych Posted January 9, 2023 Author Share Posted January 9, 2023 Yes, I just updated the Script from v6.x to v7.x and left the filters in. I am loading them via CDN: <script src="https://cdn.jsdelivr.net/npm/pixi-filters@latest/dist/pixi-filters.js"></script> Quote Link to comment Share on other sites More sharing options...
trevdev Posted February 20, 2023 Share Posted February 20, 2023 Did anyone figure this out yet? I am having this issue right now Quote Link to comment Share on other sites More sharing options...
trych Posted February 20, 2023 Author Share Posted February 20, 2023 Unfortunately not. I had to stay with PIXI v6 for the project in question. I find it strange that PIXI has a major update that apparently breaks such an essential feature. Quote Link to comment Share on other sites More sharing options...
marczi Posted October 8, 2023 Share Posted October 8, 2023 Serving pixi-filters.js locally solved me this problem. I downloaded it from here: https://github.com/pixijs/filters/releases Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.