-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
Description
Describe the bug
Hi there,
After issue #1182 has been fixed by @SamVerschueren (thank you!), I'd like to share other small issues that are now blocking to run Colyseus inside Stackblitz.
- We include
@pm2/ioas a dependency (popular Node.js library with +1M downloads). I had to do the following workaround to prevent crashes due to including@pm2/io:
const _getActiveRequests = process._getActiveRequests;
process._getActiveRequests = function (...args) { return _getActiveRequests(...args) || []; };
const _getActiveHandles = process._getActiveHandles;
process._getActiveHandles = function (...args) { return _getActiveHandles(...args) || []; };-
It seems there's some issue handling Buffers in webcontainer-core. In order to allow connecting a client with the server, I had to increase the
maxPayloadofwspackage from8192to16384. -
After connecting a client with the server, when trying to send a message, we get the following error:
Error: Data read, but end of buffer not reached {}
at checkedRead (file:///home/projects/colyseus-app/node_modules/@colyseus/msgpackr/unpack.js:258:10)
at Module.unpack (file:///home/projects/colyseus-app/node_modules/@colyseus/msgpackr/unpack.js:146:10)
at MyRoom._onMessage (file:///home/projects/colyseus-app/node_modules/@colyseus/core/build/Room.mjs:721:70)
at WebSocket.emit (node:events:30:11034)
at Receiver.receiverOnMessage (/home/projects/colyseus-app/node_modules/@colyseus/ws-transport/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:30:11034)
at Receiver.dataMessage (/home/projects/colyseus-app/node_modules/@colyseus/ws-transport/node_modules/ws/lib/receiver.js:569:14)
at Receiver.getData (/home/projects/colyseus-app/node_modules/@colyseus/ws-transport/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/home/projects/colyseus-app/node_modules/@colyseus/ws-transport/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/home/projects/colyseus-app/node_modules/@colyseus/ws-transport/node_modules/ws/lib/receiver.js:94:10)
uKRFHQiE5 left!
Link to the blitz that caused the error
https://stackblitz.com/edit/colyseus-app?file=WEBCONTAINER_CORE_WORKAROUNDS.md
Steps to reproduce
From the "playground" web interface:
- Click "Join or Create" to join a room
- In the "Inspect connection" panel, click to "Send message"
(See WEBCONTAINER_CORE_WORKAROUNDS.md file from provided example project )
Expected behavior
No errors should be observed from the server-side
Parity with Local
- I have run the project in my local machine and I could not reproduce the issue.
Screenshots
Platform
Browser name = Chrome
Full version = 135.0.0.0
Major version = 135
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
performance.memory = {
"totalJSHeapSize": 164488934,
"usedJSHeapSize": 116168714,
"jsHeapSizeLimit": 2248146944
}
Hash = d69c5f7b
Additional context
No response
