Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ReferenceError: regeneratorRuntime is not defined

Open
#71 4 comments 0 reactions 0 assignees View on GitHub

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

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

documentation question

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:
image

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developit/workerize-loader

All issues in developit/workerize-loader

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.