# \[uibuilderfe:socket-disconnect\] Reason: transport close when receiving json from node-red

**URL:** https://discourse.nodered.org/t/uibuilderfe-socket-disconnect-reason-transport-close-when-receiving-json-from-node-red/52288
**Category:** General
**Tags:** uibuilder
**Created:** [16 October 2021 08:49 UTC](https://discourse.nodered.org/t/uibuilderfe-socket-disconnect-reason-transport-close-when-receiving-json-from-node-red/52288 "2021-10-16T08:49:07Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [16 October 2021 10:53 UTC](https://discourse.nodered.org/t/uibuilderfe-socket-disconnect-reason-transport-close-when-receiving-json-from-node-red/52288/4 "2021-10-16T10:53:16Z")

</div>

> [@fangfang94](#):
>
> if the excel have 100-200 rows (test data) it will work fine.  
> but for the real data usually have 1,000 - 5,000 rows and my dev console will return
> 
> `[uibuilderfe:socket-disconnect] Reason: transport close`

Found this discussion on the [socket.io](http://socket.io) github. Maybe its related

> <https://github.com/socketio/socket.io/issues/3946>
>
> \*\*Describe the bug\*\*
> 
> \* Everytime a certain amunt of data is sent by the clien…t, the socket disconnects instantly.
> \* I am using socket.io@4.1.2
> \* Client in browser (latest Chrome)
> \* Server on Node@16
> 
> 
> \## Steps to reproduce
> 
> \* Connect to server
> \* Let client send a packet that is at least \`1e6\` in size (code sample below)
> \* You will see it disconnect instantly.
> 
> 
> \## Code Sample
> 
> Socket.IO server version: \`4.1.2\`
> 
> \*\*Server\*\*
> 
> \`\`\`js
> import { Server } from "socket.io";
> 
> const io = new Server(3000, {});
> 
> io.on("connection", (socket) =\> {
> console.log(\`connect ${socket.id}\`);
> 
> socket.on("disconnect", () =\> {
> console.log(\`disconnected ${socket.id}\`);
> });
> 
> socket.on("noop", (data) =\> {
> console.log(\`noop received: ${data.length}\`);
> });
> });
> \`\`\`
> 
> Socket.IO client version: \`4.1.2\`
> 
> \*\*Client\*\*
> 
> \`\`\`js
> import { io } from "socket.io-client";
> 
> const socket = io("ws://localhost:3000/", {});
> 
> socket.on("connect", () =\> {
> console.log(\`connect ${socket.id}\`);
> 
> // NOTE: if you change N to 999000, it will NOT disconnect!
> const N = 1e6;
> const noopData = new Array(N).fill(1).join('');
> socket.emit('noop', noopData);
> console.warn(\`noop sent, N=${N}\`);
> });
> 
> socket.on("disconnect", () =\> {
> console.log("disconnect");
> });
> \`\`\`
> 
> \*\*Expected behavior\*\*
> 
> Don't disconnect arbitrarily.
> 
> \*\*Platform:\*\*
> - Device: PC
> - OS: Windows10
> 
> 
> \*\*Further Analysis\*\*
> 
> \* I find the issue to also exist in \`socket.io@3\`, but not in \`socket.io@2\`, which works just fine.
> \* I debugged the issue and found that \`N=1e6\` will disconnect, while \`N=999000\` will NOT disconnect.
> \* That seems to indicate that whatever bug it is, it is largely tied to some sort of 1MB quota.
> \* When putting a breakpoint in the \`onClose\` handler in \`./node\_modules/engine.io-client/lib/transports/websocket.js\`, you can debug the native WebSocket error event (which is in \`arguments\[0\]\`).
> \* It's code is \`1005\`.
> \* \[According to MDN\](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent), code 1005 - "Indicates that no status code was provided even though one was expected."

---

_[View the full topic](https://discourse.nodered.org/t/uibuilderfe-socket-disconnect-reason-transport-close-when-receiving-json-from-node-red/52288)._
