diff --git a/packages/reshow-app/package.build.json b/packages/reshow-app/package.build.json index 868ea172..de265531 100644 --- a/packages/reshow-app/package.build.json +++ b/packages/reshow-app/package.build.json @@ -1,6 +1,6 @@ { "name": "reshow-app", - "version": "0.17.26", + "version": "0.17.27", "description": "Reshow App Files", "repository": { "type": "git", diff --git a/packages/reshow-app/src/server.js b/packages/reshow-app/src/server.js index 2e9f3d76..bff065b2 100644 --- a/packages/reshow-app/src/server.js +++ b/packages/reshow-app/src/server.js @@ -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);