Hi,
We’ve run into this issue multiple times where Web Sight will not load in the browser due to either the lib/js/cytoscape.js or lib/js/three/three.js files not loading properly from the web server.
What happens:
- Run follow_me app
- Go to host:3000
- Page does not load fully
- Chrome developer tools console shows “net::ERR CONTENT LENGTH MISMATCH” in response to a file request
- Chrome developer tools shows constant errors on each tick, either:
- cyctoscape is not defined (from the Pose Tree implementation) and cytoscape.js seems to be missing in the 'Sources' tab
- THREE is not defined
This does not happen consistently, but often enough to be an issue. I had to refresh quite a few times to replicate.
What I believe the issue is:
In WebsightServer.cpp:193:
res->end(buffer.data(), buffer.size());
From uWebSockets documentation:
You should never call res.end(huge buffer). res.end guarantees sending so backpressure will probably spike. Instead you should use res.tryEnd to stream huge data part by part. Use in combination with res.onWritable and res.onAborted callbacks.
Cytoscape.js and three.js are big files. Unfortunately, the early version of the library Isaac uses does not implement tryEnd.
Any thoughts/suggestions?