Failing to compile web-worker during vite build
projjal1 opened this issue · comments
Projjal Gop commented
During compilation with vite build, the compiler is giving error message as cannot destructure property mod from threads.workerData as it's undefined.
Mathew Chan commented
Had the same issue, I think in line 130 in node.js we need to check if threads.workerData is undefined, or set it as an empty object. This should fix it:
let {
mod,
name,
type
} = threads.workerData || {};
UPDATE: Looks like the author already had a fix for the root cause here: #40