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
When running nx show project --json foobar with Node.js spawn, exec, spawnSync, etc., the output is truncated to 8192 characters.
Expected Behavior
The output is returned in full.
GitHub Repo
No response
Steps to Reproduce
Get big enough project.json
Run
const{ exec }=require('node:child_process');asyncfunctiontest(){constcommand=exec(`nx show project --json projectName`);letoutput='';command.stdout?.on('data',(data)=>(output+=data.toString()));constpromise=newPromise((resolve)=>{command.on('close',(code)=>{if(code!==0){console.error(`Error when running command, code: ${code}`);}// @ts-ignoreresolve();});});awaitpromise;console.log(`output: ${output}`);JSON.parse(output);// this will crash if the output is not full}test().catch(e=>console.error(e));
or
const{ spawnSync }=require('node:child_process');constcommandResult=spawnSync(`nx show project --json someProject`);constprojectInfo=commandResult.stdout.toString();console.log(`output: ${projectInfo}`);JSON.parse(projectInfo);// this will crash if the output is not full
I just confirmed locally that the nx show project --json works fine with Node's exec in [email protected], which is the first version that received the fix (#19793).
Current Behavior
When running
nx show project --json foobar
with Node.jsspawn
,exec
,spawnSync
, etc., the output is truncated to 8192 characters.Expected Behavior
The output is returned in full.
GitHub Repo
No response
Steps to Reproduce
project.json
or
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
This has been already reported a year ago in #19059 and then fixed in #19793
But since then I see that the source code was refactored, and the
await output.drain()
line is nowhere to be found.The text was updated successfully, but these errors were encountered: