We have created a solution based on template sitecore.aspnet.gettingstarted
for Sitecore ASP Net Core Rendering SDK headless.
Pushed all the Sitecore items available in this solution successfully and hosted RenderingHost application as well on IIS.
I am able to browse the home page when I hit the RenderingHost website on browser but when I try to open the same item in the Experience Editor getting following issue:
Error Rendering Sitecore.JavaScriptServices.ViewEngine.Presentation.JsLayoutRenderer: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Sitecore.JavaScriptServices.ViewEngine.Http.RenderEngine.Invoke[T](String moduleName, String functionName, Object[] functionArgs)
at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.PerformRender(TextWriter writer, IRenderEngine renderEngine, String moduleName, String functionName, Object[] functionArgs)
at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.Render(TextWriter writer)
at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
Using Sitecore 10.1 on-prem over IIS (no docker)
When I try to debug the code, i don't see any error on the code.
Following is the appsettings.json file at RenderingHost application:
{
"Sitecore": {
"InstanceUri": "https://sc101sc.dev.local",
"LayoutServicePath": "/sitecore/api/layout/render/jss",
"DefaultSiteName": "AspCoreHeadless",
"ApiKey": "d807e76d-3151-41a9-8e1a-ffede8851926",
"EnableExperienceEditor": true
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
Can someone help in resolving this issue?
Thanks,