npm install @pixi/node
apt remove librsvg2-dev # On Debian/Ubuntu; use other commands on other platforms
npm rebuild canvas --build-from-source
vim test.mjs
// test.mjs
import { Assets, SVGResource, BaseImageResource, utils } from '@pixi/node';
import { Image } from 'canvas';
await Assets.init({ skipDetections: true }); // work around #6
// work around #4
let src = SVGResource.prototype._loadSvg.toString().match(/\{(.*)\}/s)[1];
src = src.replace(/tempImage\.src\s*=\s*this\.svg[,;]/, '');
src += 'tempImage.src = this.svg;';
SVGResource.prototype._loadSvg = new Function(
'Image', 'BaseImageResource', 'uid',
`return (function _loadSvg() { ${src} });`
)(Image, BaseImageResource, utils.uid);
const asset = await Assets.load('https://raw.githubusercontent.com/UlyssesZh/drawings/master/78(/78(.svg');
console.log(asset);
On Ubuntu 20.04, node test.mjs exits with status 13 without printing anything. On Windows Server 2022, it is stuck forever.
Reproduceable with both @pixi/node 7.2.0 and 7.3.0.
To reproduce:
On Ubuntu 20.04,
node test.mjs
exits with status 13 without printing anything. On Windows Server 2022, it is stuck forever.Reproduceable with both
@pixi/node
7.2.0 and 7.3.0.