What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

前端 未结 22 2771
無奈伤痛
無奈伤痛 2020-12-01 02:24

I\'m currently working on a website, which triggers a net::ERR_HTTP2_PROTOCOL_ERROR 200 error on Google Chrome. I\'m not sure exactly what can provoke this erro

22条回答
  •  执念已碎
    2020-12-01 03:03

    For my situation this error was caused by having circular references in json sent from the server when using an ORM for parent/child relationships. So the quick and easy solution was

    JsonConvert.SerializeObject(myObject, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore })
    

    The better solution is to create DTOs that do not contain the references on both sides (parent/child).

提交回复
热议问题