Skip to content

Commit 5dd2fa1

Browse files
committed
Don't crash when the binary command returns a large json.
Fixes #305
1 parent 8071637 commit 5dd2fa1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Fixes:
1717
- Fix issue in JSX autocompletion where the `key` label would always appear.
1818
- Fix issue in record field autocomplete not working with type aliases.
1919
- Fix issue where autocomplete for local values would not work in the presence of `@react.component` annotations.
20+
- Fix issue where the server would crash on large output produced by the binary command.
2021

2122
## 1.1.3
2223

server/src/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ export let runAnalysisAfterSanityCheck = (
142142
if (projectRootPath == null) {
143143
return null;
144144
}
145-
let stdout = childProcess.execFileSync(binaryPath, args, {
145+
let options: childProcess.ExecFileSyncOptions = {
146146
cwd: projectRootPath,
147-
});
147+
maxBuffer: Infinity,
148+
};
149+
let stdout = childProcess.execFileSync(binaryPath, args, options);
148150
return JSON.parse(stdout.toString());
149151
};
150152

0 commit comments

Comments
 (0)