GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cannot require sqlite3 in both a main thread and a worker thread · Issue #1223 · TryGhost/node-sqlite3

This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Cannot require sqlite3 in both a main thread and a worker thread #1223

Copy link
Copy link
Closed
Closed
Cannot require sqlite3 in both a main thread and a worker thread#1223
Copy link

Description

@mohd-akram
mohd-akram
opened on Sep 27, 2019
Issue body actions

OS: macOS 10.14.6
node version: 12.10.0
sqlite3 version: 4.1.0

  1. Create main.js:
const { Worker } = require('worker_threads');
require('sqlite3');
new Worker('./worker.js');
  1. Create worker.js:
require('sqlite3');
  1. Run node main.js

Output:


events.js:186
      throw er; // Unhandled 'error' event
      ^
Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:977:18)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/user/Downloads/test-sqlite3/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
Emitted 'error' event on Worker instance at:
    at Worker.[kOnErrorMessage] (internal/worker.js:176:10)
    at Worker.[kOnMessage] (internal/worker.js:186:37)
    at MessagePort.<anonymous> (internal/worker.js:118:57)
    at MessagePort.emit (events.js:209:13)
    at MessagePort.onmessage (internal/worker/io.js:70:8)

Activity

  1. kewde commented on Sep 30, 2019

    @kewde
    kewde
    on Sep 30, 2019
    Collaborator
    More actions

    Hi,

    worker_thread is unsupported at the moment.
    See #1007

    and the PR was reverted:
    #1009

    I don't know why it was reverted, so I will investigate.

  2. pacop commented on Oct 28, 2019

    @pacop
    pacop
    on Oct 28, 2019
    More actions

    Hi,

    is some news right here? Thanks @kewde

  3. mohd-akram commented on Jul 26, 2020

    @mohd-akram
    mohd-akram
    on Jul 26, 2020
    ContributorAuthor
    More actions

    This is fixed in v5.0.0, but there are other issues with worker threads.

  4. mohd-akram
    closed this as completedon Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.