#Bundle web worker for npm package
1 messages · Page 1 of 1 (latest)
const worker = new Worker(new URL('./workers/arnft.worker.ts', import.meta.url), { type: 'module' });
the import code
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
the error
Idk, i try to install this @surma/rollup-plugin-off-main-thread but the results are the same
the problem may be that worker get's under assets/arnft.worker.505770f1.js
and react just not serving it from package...
mkay if i copy arnft.worker.4e733d5c.js to public it does work
But anyone has any clue how can i encode it to base64 directly?
it looks like it is serving the script but it's not what it expects it to be
there's some info about the strict html checking here: https://web.dev/module-workers/