Fix RPC Server Error: TypeError: Cannot read property 'readable' of undefined at IncomingMessage._read (_http_incoming.js:120:19) #477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When attempting to work through the reach-sh guides I found that the RPC Server
reach rpc-server
would not handle any requests. Any request would crash rpc server with the following output:In the above crash, I attempted to perform the following request:
I did some investigation and found this issue for express library: expressjs/express#3388
Apparently, the current version of express (v4) is not compatible with http2. Suggestions are to upgrade to express v5 or use spdy for http2. Since v5 is still in alpha stage, decided to use the more stable spdy library in place of http2.
DESIGN
There are no fundamental design changes or impact from this change.
TESTING
I used the following test scenario (On mac Mojave 10.14.6):
sh ./serve.sh
DOCS
This is a trivial change to the internals of rpc-server operation that doesn't warrant any documentation updates.