skip to Main Content

Javascript – Nuxt 3 Web Worker

My Nuxt 3 app needs to run some possibly heavy string-related calculations so I want to move them in worker: // /assets/workers/test.ts // import someStuff from "my-package-in-node_modules" console.log('Hello from worker!'); onmessage = () => { /* Do stuff... */ }…

VIEW QUESTION

Cannot call an external file when running JavaScript in Firefox

I'm trying to run this in my index.html: <script> var stockfish = new Worker('./js/stockfish.js'); stockfish.addEventListener('message', function (e) { console.log(e.data); }); stockfish.postMessage('uci'); </script> But I get the following error: Security error: content located at file:///D:/ChessComparator/index.html cannot load data from file:///D:/ChessComparator/js/stockfish.js. I…

VIEW QUESTION
Back To Top
Search