josdejong / workerpool

Offload tasks to a pool of workers on node.js and in the browser
Apache License 2.0
2.04k stars 148 forks source link

What should I do to solve the error I introduced into the vue project? Do I need to configure something in webpack #430

Closed wangyiyou closed 5 months ago

wangyiyou commented 6 months ago

1708504543716

josdejong commented 6 months ago

The package is a CommonJS / UMD build, maybe that requires some configuration in your ESM setup?

How can we reproduce your issue?

wangyiyou commented 6 months ago

该包是 CommonJS / UMD 构建,也许需要在您的 ESM 设置中进行一些配置?

我们如何重现您的问题?

Thank you for your reply. I hope I can use it directly after install. However, there are some errors now. I have looked through the past questions and found no direct answer As for the recurrence problem, I just introduced it and reported an error. I don't know if there is the same problem as me

josdejong commented 6 months ago

I had a closer look at the error message, it says "Module parse failed: unexpected token (509:30)" in the file workerpool/dist/workerpool.js. At that position in the code, optional chaining ?. is used. So, this is not an issue with ESM/CommonJS, but a relatively new JavaScript operator that is not understood by your setup. The optional chaining operator was introduced 4 years ago. I guess that you have to update your Webpack setup to support the latest JavaScript features.

josdejong commented 5 months ago

Closing due to a lack of response. Please reopen if needed.