Closed zewa666 closed 2 years ago
when setting isolate: false
it starts to work though this is more of a workaround. anyways, since I'm tbh not sure whether its Vitest, Phaser or Canvas causing the root issue I'll close this one.
I came across the same problem using node-canvas with pdfjs-dist
sadly isolate: false
did not work for me...
but, I kept reading the vitest document and found this!
https://vitest.dev/config/#pool-1-0-0 Some libraries written in native languages, such as Prisma, bcrypt and canvas, have problems when running in multiple threads and run into segfaults. In these cases it is advised to use forks pool instead.
and setting pool: 'forks'
worked like a charm!
Anyways thanks for pointing out, saved my day!
Issue or Feature
I'm using node-canvas through JSDOM in a Vitest where I'm trying to setup a PhaserJS game. The initial execution works perfectly but on a test-watcher rerun the execution crashes or, even worse, the terminal keeps hanging, on Ubuntu. On Windows it merely crashses all the time.
Steps to Reproduce
Here's a repro with instructions in the readme https://github.com/zewa666/phaser-vitest-bug
Your Environment
npm list canvas
oryarn list canvas
): 2.10.1