Hello,
I encountered an issue trying to load node-expat in the context of a worker thread, see the minimal reproduction below:
{
"name": "node-expat-bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"node-expat": "^2.3.18"
}
}
const { Worker, isMainThread } = require('worker_threads')
if (isMainThread) {
// Require in the top-level context works fine.
require('node-expat')
worker = new Worker(__filename)
} else {
// Require in the context of a worker thread throws an exception:
//
// Error: Module did not self-register: ...
//
require('node-expat')
}
This may be an example of how to fix it schroffl/node-lzo#11
Does this module aim to be usable in the context of a worker threads?
Hello,
I encountered an issue trying to load
node-expatin the context of a worker thread, see the minimal reproduction below:{ "name": "node-expat-bug", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "node-expat": "^2.3.18" } }This may be an example of how to fix it schroffl/node-lzo#11
Does this module aim to be usable in the context of a worker threads?