Hi, I am having issues where my exported Windows build game does not run properly and does not produce any errors.
I am not using the advanced Worker properties in Construct 3.
However, I wrote my own script to run the worker. I tested it on the Construct 3 editor, and it work and run as intended. However, once I exported it to a Windows build without minify mode, it runs but does not respond or show any error from the script in worker.js.
//main.js
console.log("main call worker.js");
const worker = new Worker('worker.js');
worker.postMessage({
type: 'processMoves',
});
worker.onmessage = (event) => {
if (event.data.type === 'bestMove') {
//Do Something
}
}
worker.terminate();
self.addEventListener('message', async function(event) {
if (event.data.type === 'processMoves') {
console.log("Worker start");
try {
// Do somthing
console.log("Worker end");
self.postMessage({ type: 'bestMove', bestMove: bestMove});
} catch (error) {
console.error('Error processing moves:', error);
}
}
});
Expected it to print out "Worker start" and "Worker end" in the window build, however nothing happen.
Did i miss something or worker does not work on window build ?