andywer / andywer/threads.js

Confusion with Node.js native Worker

未关闭
#315 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement help wanted
主要语言
TypeScript
星标
3.5k
派生
173
PR 合并指标
30 天内没有已合并 PR

描述

I'm using the threads-plugin for webpack.

I'm creating a new worker the normal way:
`new ThreadManager(new Worker('path/to/worker'), 2)`

But keep getting the 404 error. I tried everything to fix it, can't understand why it's doing it.
Until I realize that I didn't add this line:
`import { Worker } from 'threads'`

This has already happened multiple times. Is there anything Threads.js can do to prevent this from happening again? I'm sure others are having the same problem.

Better error messages in general would also be nice. Now they almost always end up as a 404 error with 10 seconds later a timeout. I understand that this might not be the easiest thing with webpack and all. But I'm quite sure a lot of new users run into these unhelpful errors and debugging this can be really hard.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。