You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportfunctionregisterWorker(threadName: number,filePath: string,isTypescript: boolean=true,maxThreads: number=4){if(filePath.startsWith("@")){// atPath is project root pathfilePath=path.join(atPath,filePath.slice(2)+(isTypescript ? '.ts' : '.js'));}constpool=newPiscina({filename: filePath,
maxThreads,// !!: Hear, it is not work.But it is work in worker_threads
...(isTypescript ? {execArgv: ['-r','ts-node/register']} : {}),})returnpool;}
The text was updated successfully, but these errors were encountered:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ....
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
at defaultLoad (node:internal/modules/esm/load:101:20)
at ModuleLoader.load (node:internal/modules/esm/loader:417:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:288:22)
at new ModuleJob (node:internal/modules/esm/module_job:63:26)
at ModuleLoader.#createModuleJob (node:internal/modules/esm/loader:312:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:265:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:251:17) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
The text was updated successfully, but these errors were encountered: