Pipelining example code throws "OffscreenCanvas is not defined"

What is wrong?
The pipelining example code doesn't work, it throws an OffscreenCanvas is not defined error.
Where does it happen?
In gpu.js when running the pipelining example code.
How do we replicate the issue?
- Platform: Windows 10
- Node version: 16.14.0
- gpu.js version: 2.15.0
Run the following code (slightly modified from the pipeline example in the readme):
const { GPU } = require('gpu.js');
const gpu = new GPU();
const kernel1 = gpu.createKernel(function () {
return this.thread.x;
})
.setPipeline(true)
.setOutput([100]);
const kernel2 = gpu.createKernel(function (v) {
return v[this.thread.x];
})
.setOutput([100]);
const result1 = kernel1();
// Result: Texture
console.log(result1.toArray());
// Result: Float32Array[0, 1, 2, 3, ... 99]
const result2 = kernel2(result1);
// Result should be: Float32Array[0, 1, 2, 3, ... 99]
console.log(result2);
How important is this (1-5)?
From what I understand, getting this to work would massively reduce overhead. I'm not sure if this is a bug or if the example code has some mistake I don't see. I would rate it a 3 since it's an important feature that I (and probably other newcomers) can't use.
Expected behavior (i.e. solution)
The [0, 1, 2, 3, ... 99] array should simply be printed twice in the example. I'm afraid I don't know the solution ;-;
I had the same issue, but it seemed to work fine in the most recent maintenance release on Jan 19, 2021 https://github.com/gpujs/gpu.js/releases
Thank you, that release works! Weird since the release on the npm repo doesn't. It seems that the newer versions broke this.