I’m trying to use web worker in my project. It works fine in the dev mode but failed after build.
Uncaught DOMException:
Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:4000/js/js/vendor.4a4f636a.js' failed to load.
The file structure is shown as follow
It seem that an extra “js/” is added in the link. The correct link for the script file should be http://localhost:4000/js/vendor.4a4f636a.js
To reproduce, I create a small repo.
It is strange that it works after removing the for loop in src/worker/load_data.js.
Have I done something wrong? Are there any configurations needed to make this work?