socket.io-client-unity3d icon indicating copy to clipboard operation
socket.io-client-unity3d copied to clipboard

ArgumentException: JSON parse error: The document root must not follow by other values.

Open Zeon8 opened this issue 5 years ago • 2 comments

I paste code from wiki https://github.com/nhn/socket.io-client-unity3d/wiki/Sample#2-acks-message and run nodejs server and run unity client and in log this error: ArgumentException: JSON parse error: The document root must not follow by other values. UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at C:/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:50) UnityEngine.JsonUtility.FromJson[T] (System.String json) (at C:/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:33) socket.io.SocketInitializer+<InitCore>d__21.MoveNext () (at Assets/Plugins/socket.io/SocketInitializer.cs:138) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17

My Laptop: Intel Pentium 2020m 4 GB RAM Intel® HD Graphics for 3rd Generation Intel® Processors

Zeon8 avatar Jun 02 '19 12:06 Zeon8

Hi, i'm also face this error. Here is my way to fix this:

image

sandichhuu avatar Feb 03 '20 07:02 sandichhuu

You should use an older version of socket.io specifically 1.7.4 the latest 1.x version

iglikoxha avatar Mar 25 '20 16:03 iglikoxha