I am planning to have worker threads for socket.io rooms. I create a worker thread on the first connection to a room which then sets up firebase listeners.
Unfortunately. I have common imports in the worker file and my main source code.
I followed this article to allow running ts files via worker_threads -> https://wanago.io/2019/05/06/node-js-typescript-12-worker-threads/
Unfortunately, I dont get top-level await and upon starting the worker thread, I get the following error.
error TS2451: Cannot redeclare block-scoped variable 'tslib_1'.\r\n"
Here is my tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"lib": ["esnext"],
"module": "commonjs",
"importHelpers": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"baseUrl": ".",
"sourceMap": true,
"declaration": false,
"noImplicitAny": false,
},
"files": [
"typings.d.ts"
],
}