Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

snappy cannot be imported in worker threads #178

Closed
achille-roussel opened this issue Mar 10, 2020 · 0 comments · Fixed by #179
Closed

snappy cannot be imported in worker threads #178

achille-roussel opened this issue Mar 10, 2020 · 0 comments · Fixed by #179

Comments

@achille-roussel
Copy link
Contributor

Hello,

I encountered an issue trying to load node-expat in the context of a worker thread, see the minimal reproduction below:

const { Worker, isMainThread } = require('worker_threads')

if (isMainThread) {
  // Require in the top-level context works fine.
  require('snappy')
  worker = new Worker(__filename)
} else {
  // Require in the context of a worker thread throws an exception:
  //
  //    Error: Module did not self-register: ...
  //
  require('snappy')
}

I think may be related to schroffl/node-lzo#11

Does this module aim to be usable in the context of a worker threads?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant