ReferenceError: regeneratorRuntime is not defined
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- babel, javascript, typescript, webpack
- Domain
- build-system, tooling
Research direction
Start by reproducing the failure from queue.worker.ts and somewhere.ts using the shown workerize-loader and babel-loader configuration. Inspect how the worker bundle handles the async function and Babel runtime, then verify that calling getShuffledTracks no longer raises ReferenceError: regeneratorRuntime is not defined.
Written by the indexing model from the issue text.
Description
I'm trying to use this library with Babel and TypeScript, but I'm getting a weird error.
// queue.worker.ts
import { TrackData } from "modules/track/types"
import { shuffleArray } from "common/lang/array/helpers/shuffleArray"
export async function getShuffledTracks(tracks: TrackData[], active: number) {
return shuffleArray(tracks).sort((track) => (track.id === active ? -1 : 0))
}
// somewhere.ts
import * as QueueWorker from "../queue.worker"
const worker = (QueueWorker as any)() as typeof QueueWorker
// somewhere in the file
await worker.getShuffledTracks(...)
Then, when the function is called, I get this error:

This is what the config for the loader looks like:
const workerRule = {
test: /\.worker\.ts$/,
use: [
"workerize-loader",
{
loader: "babel-loader",
options: {
presets: [
[
"@babel/env",
{
modules: false,
},
],
],
},
},
],
}
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developit/workerize-loader
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#131 · 6 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
developit/workerize-loader#130 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
developit/workerize-loader#129 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
developit/workerize-loader#128 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#126 · 4 comments ·
All issues in developit/workerize-loader
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
neondatabase/website#5944 ·
-
module: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·