Uncaught RangeError: Maximum call stack size exceeded (Unity 5.1 -> HTML5 (webGL))
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hello there, I've begun to work with WebSockets in C# with this nice plugin thing but I can't seem to get it working, I have a WebSocket Server made in a console application which is working nice, and if I start the client from the Unity Editor it works just fine, it's only when I export to HTML5 (WebGL) that it pops up me an error as soon as the game has loaded.
This is the log:
Invoking error handler due to
Uncaught RangeError: Maximum call stack size exceeded
And this is my client code:
using UnityEngine;
using System.Collections;
using System;
using WebSocketSharp;
public class NetworkHandler : MonoBehaviour {
IEnumerator Start()
{
WebSocket ws = new WebSocket("ws://127.0.0.1:9090/server");
ws.OnMessage += OnReceivedMessage;
ws.OnOpen += OnOpened;
ws.Connect();
yield return new WaitForSeconds(1);
ws.Send("Client saying hi");
}
public void OnReceivedMessage(object sender, MessageEventArgs e)
{
Debug.Log("Server says: " + e.Data);
}
public void OnOpened(object sender, EventArgs e)
{
Debug.Log("Established Connection with a Game Server!");
}
}
Please let me know what am I doing wrong, or if this is something I can't really fix so I can move on!
Thankyu beforehand
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the NetworkHandler code in the issue, especially WebSocket construction and ws.Connect(), and reproduce the export in Unity 5.1 HTML5/WebGL rather than the Unity Editor. Compare the WebGL log with the editor run to determine whether the stack overflow comes from this connection path or the platform export. Done means identifying a reproducible cause and a supported fix or clear compatibility conclusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100