Skip to content

Commit

Permalink
fixed EAGAIN, Resource temporarily unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Apr 13, 2022
1 parent 81f0719 commit c62ef6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/reshow-app/package.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reshow-app",
"version": "0.17.26",
"version": "0.17.27",
"description": "Reshow App Files",
"repository": {
"type": "git",
Expand Down
10 changes: 8 additions & 2 deletions packages/reshow-app/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ const ReactServer = {
const server =
(app, renderTo = "renderToReadableStream") =>
({ process, fs, JSON, Buffer }) => {
const fd = process.stdin.fd;
const inputData = fs.readFileSync(fd, { encoding: "utf8", flag: "r" });
/**
* why use /dev/stdin?
* https://github.com/react-atomic/reshow/issues/119
*/
const inputData = fs.readFileSync("/dev/stdin", {
encoding: "utf8",
flag: "r",
});
const result = ReactServer[renderTo](build(app)(JSON.parse(inputData)));
if ("renderToPipeableStream" !== renderTo) {
process.stdout.write(SEPARATOR);
Expand Down

0 comments on commit c62ef6a

Please sign in to comment.