In PIXI 8, you need to use the App variable created at the beginning
//created at start
import {Application, Sprite, Container} from "pixi.js";
let App = new Application();
//use inside your application
let sprite = Sprite.from(App.renderer.generateTexture(container));
Where container
is a variable of type `Container` that has the other sprites in it that you want to be part of the mask. Basically, exactly like @Zyie's answer, but updated for Pixi 8.