Category : web-worker

Here is my code: const worker = new Worker(‘./app.worker.ts’, { type: ‘module’ }); console.log(‘this is the worker’); console.log(worker); worker.onmessage = ({ data }) => { console.log(`page got message: ${data}`); }; worker.postMessage(‘hello’); It is having trouble on that first line. If I remove the {type: ‘module’} it does not give me the error (but it also ..

Read more

I keep getting the following error: No template for dependency: ConstDependency When using web workers Here is my code: const worker = new Worker(‘./app.worker.ts’, { type: ‘module’ }); console.log(‘this is the worker’); console.log(worker); worker.onmessage = ({ data }) => { console.log(`page got message: ${data}`); }; worker.postMessage(‘hello’); It is having trouble on that first line. If ..

Read more

I am using Angular (last version i guess) well all work perfectly but when i add this ligne in my PlanetMaterialManager class angular will just compile but no making any changes in the broswer. const { heightDataResult, specularDataResult, diffuseDataResult } = await TextureBuilder.buildTextures(hashStringToInt(this.options.terrainSeed), this._noiseSettings, heightMapImage, specularMapImage, diffuseMapImage) the class code : const backgroundWorker = require(‘worker-loader!./TextureBuilder.worker’) ..

Read more