问题产生
three.js开发中 使用web worker 引入外部对象和第三方库 开发时没有问题 打包后出现报错导致web worker无法使用

​Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://hongbin.xyz:3000/static/js/951.7b705045.chunk.js' failed to load.​

​Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at ​

Uncaught NetworkError: Failed to execute ‘importScripts‘ on ‘WorkerGlobalScope‘: The script at xxxx_webpack


原因 引用了第三方库

Uncaught NetworkError: Failed to execute ‘importScripts‘ on ‘WorkerGlobalScope‘: The script at xxxx_js开发_02

解决
从creata-ract-app迁移到了next.js莫名奇妙解决了 可能是打包的工作不同 CRA的 webpack在开发阶段时可以正常的. next似乎使用了 SWC 来处理

Uncaught NetworkError: Failed to execute ‘importScripts‘ on ‘WorkerGlobalScope‘: The script at xxxx_js开发_03