Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise rejection: Error: start() called while command is running #54

Open
prafed opened this issue Apr 1, 2022 · 0 comments

Comments

@prafed
Copy link

prafed commented Apr 1, 2022

Unhandled promise rejection: Error: start() called while command is running

..REDACTED../node_modules/estrella/dist/estrella.js:8
+u),new Error(command exited with status ${l}${u})}let c=i.buffer();return t?c.toString(t):c})}wait(t,r){return t===void 0||t<=0?this.promise:this._waitTimeout(t,(n,o,i)=>(a.debug(()=>${this} wait timeout reached; killing process),n.message="Cmd.wait timeout",this.kill(r).then(()=>i(n))))}signal(t,r){let n=this._checkproc();if(r=="group")try{return process.kill(-n.pid,t),!0}catch(o){}return n.kill(t)}async kill(t="SIGTERM",r=500,n){let o=this._checkproc();return this.signal(t,n||"group")?r<=0?this.promise:this._waitTimeout(r,(i,s)=>(a.debug(()=>${this} kill timeout reached; sending SIGKILL),o.kill("SIGKILL"),this.promise.then(s))):o.exitCode||0}toString(){return this.process?Cmd[${this.pid}]:"Cmd"}_checkproc(){if(!this.process)throw new Error(Cr);return this.process}_rejectAndKill(t){this._reject(t)}_waitTimeout(t,r){return new Promise((n,o)=>{let i=!1;return this.promise.then(s=>{i||n(s)}),xr(this.promise,t,s=>{i=!0,r(s,n,o)})})}};Ue.prototype.start=function(){let t=this;if(t.running)throw new Error("start() called while command is running");t.exitCode=-1,t.promise=new Promise((l,c)=>{t._resolve=l,t._reject=c});let r=null,n=null;t.stdin instanceof Buffer?r="pipe":gr(t.stdin)?typeof t.stdin.stream.fd=="string"?r=t.stdin.stream:(r="pipe",n=t.stdin.stream):r=t.stdin;let o={stdio:[r||"ignore",t.stdout===process.stdout?1:t.stdout||"ignore",t.stderr===process.stderr?2:t.stderr?t.stderr:"ignore",...t.extraFiles],cwd:t.dir?Yt(t.dir):void 0,env:t.env,shell:t.shell,windowsHide:t.windowsHide,detached:!ye},i=Sr.spawn(t.command,t.args,o);if(i.pid===void 0){t.process=null,t.pid=0;let l=Mn(t);throw t._reject(l),l}if(t.running=!0,t.process=i,t.pid=i.pid,i.on("exit",t._onexit),i.on("error",t._reject),a.debug(()=>${t} started (${L(t.command)})),i.stdin)if(t.stdin instanceof Buffer){let l=new Pr.PassThrough;l.end(t.stdin),l.pipe(i.stdin),i.stdin=null}else n&&(n.pipe(i.stdin),i.stdin=null);return!i.stdin&&!i.stdout&&!i.stderr&&i.stdio.length<4?null:{stdin:i.stdin?mt(i.stdin):null,stdout:i.stdout?De(i.stdout):null,stderr:i.stderr?De(i.stderr):null,extraFiles:i.stdio.slice(3).map(l=>pr(l)?De(l):mr(l)?mt(l):null)}};function Mn(e){let t="",r="unspecified error";if(e.shell==!1){try{re.accessSync(e.dir,re.constants.R_OK|re.constants.X_OK),(re.statSync(e.command).mode&re.constants.S_IFREG)==0?t="EACCES":t="EIO"}catch(o){t=o.code||"ENOENT"}r=ht(t)||r}if(!t){try{re.accessSync(e.dir,re.constants.R_OK|re.constants.X_OK),t="EIO"}catch(o){t=o.code||"ENOENT"}r=ht(t)||r,t&&(r=r+"; cmd.dir="+L(e.dir))}t||(t="UNKNOWN");let n=new Error(failed to spawn process ${L(e.command)} (${t} ${r}));return n.code=t,n}var yt=S(require("fs")),_r=S(require("os")),Tr=new Map;function Oe(e,t){let r=o=>yt.writeSync(process.stderr.fd,o+
^
at Ue.start (..REDACTED../node_modules/estrella/dist/estrella.js:8:1016)
at Fr.onEndBuild (..REDACTED../node_modules/estrella/dist/estrella.js:11:1492)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Or.e.onEnd (..REDACTED../node_modules/estrella/dist/estrella.js:11:371)
at async Kn.P (..REDACTED../node_modules/estrella/dist/estrella.js:38:220)
Looks like you found a bug in Estrella!

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

No branches or pull requests

1 participant