You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Description: I've successfully built and run an H5 project following the instructions on the project's homepage. The project builds without errors using dotnet build, and I can start an HTTP server in the output directory to serve the application. Everything works fine in the browser until I add JSON serialization code to Program.cs.
Steps to Reproduce:
Clone the H5 project from [repository URL].
Follow the build instructions on the project's homepage.
Modify Program.cs to include JSON serialization and deserialization using Newtonsoft.Json.
Build the project with dotnet build.
Start an HTTP server in the output directory and open the application in a web browser.
Expected Behavior: The application should serialize and deserialize a Person object to and from JSON without any errors, and the result should be logged to the console.
Actual Behavior: When opening the web page in the browser, I encounter the following JavaScript error: newtonsoft.json.js:340 Uncaught ctor {$init: {...}, message: 'Operation is not valid due to the current state of the object.', innerException: null, errorStack: Error: Operation is not valid due to the current state of the object.
Program.cs code as follows:
using System;
using H5;
using H5.Core;
using static H5.Core.es5;
using static H5.Core.dom;
using Tesserae;
using static Tesserae.UI;
using Newtonsoft.Json;
namespace demo3
{
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
class Program
{
static void Main(string[] args)
{
var person = new Person
{
Name = "John Doe",
Age = 30
};
{
string json = JsonConvert.SerializeObject(person);
System.Console.WriteLine("Serialized JSON: " + json);
Person deserializedPerson = JsonConvert.DeserializeObject<Person>(json);
System.Console.WriteLine("Deserialized Person Name: " + deserializedPerson.Name);
System.Console.WriteLine("Deserialized Person Age: " + deserializedPerson.Age);
}
var hello = TextBlock("Hello world!");
document.body.appendChild(hello.Render());
}
}
}
The text was updated successfully, but these errors were encountered:
Issue Description: I've successfully built and run an H5 project following the instructions on the project's homepage. The project builds without errors using dotnet build, and I can start an HTTP server in the output directory to serve the application. Everything works fine in the browser until I add JSON serialization code to Program.cs.
Steps to Reproduce:
Expected Behavior: The application should serialize and deserialize a Person object to and from JSON without any errors, and the result should be logged to the console.
Actual Behavior: When opening the web page in the browser, I encounter the following JavaScript error:
newtonsoft.json.js:340 Uncaught ctor {$init: {...}, message: 'Operation is not valid due to the current state of the object.', innerException: null, errorStack: Error: Operation is not valid due to the current state of the object.
Program.cs code as follows:
The text was updated successfully, but these errors were encountered: