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
The app is not loaded when i require it in my main entry script.
I have 2 files:
server.ts - for running workers in cluster mode
app.ts - the file that serve the application data
Context
OS version (is it docker or host?), ts-node-dev version: Docker
Did you try to run with ts-node? : yes, it's working with ts-node
Did you try to run with --files option enabled? Yes
Did you try to run with --debug option enabled? Yes
Do you have a repro example (git repo) with simple steps to reproduce your problem?
constcluster=require("cluster");constnumCPUs=require("os").cpus().length;/** Initiate a Cluster */if(cluster.isMaster){console.log(`Master ${process.pid} is running`);// Fork worker processesfor(leti=0;i<numCPUs;i++){cluster.fork();}cluster.on("online",(worker)=>{console.log(`Worker ${worker.process.pid} is running`);});// Handle worker process exit and create a new onecluster.on("exit",(worker,code,signal)=>{console.log(`Worker ${worker.process.pid} died`);cluster.fork();});}else{require("./app");// this is not loaded}
when this process excute this code, Main process code can't recevie this signal,because this child process is ts-node-dev forked process,not your your server.ts forked process,so app.ts not compiled.
Issue description
The app is not loaded when i require it in my main entry script.
I have 2 files:
Context
OS version (is it docker or host?), ts-node-dev version: Docker
Did you try to run with ts-node? : yes, it's working with ts-node
Did you try to run with
--files
option enabled? YesDid you try to run with
--debug
option enabled? YesDo you have a repro example (git repo) with simple steps to reproduce your problem?
My cli command:
ts-node-dev --respawn --transpile-only -r tsconfig-paths/register src/server.ts
Debug log:
The text was updated successfully, but these errors were encountered: