I am using Sitecore 10.2. I am able to run my sample nextjs application in connected mode using the command in VS Code terminal jss start:connected
.
But I am not able to open my application in local integrated mode and it is throwing the below error.
Error in experience editor mode/ preview mode
Error Rendering Sitecore.JavaScriptServices.ViewEngine.Presentation.JsLayoutRenderer: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Sitecore.JavaScriptServices.ViewEngine.Http.XmlConfigurationReader.ProcessPropertyNode(XmlNode propertyNode, HttpRenderEngineOptions options)
at Sitecore.JavaScriptServices.ViewEngine.Http.XmlConfigurationReader.CreateOptionsFromConfig(XmlNode config)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Sitecore.JavaScriptServices.ViewEngine.Http.XmlConfigurationReader.GetAll()
at Sitecore.JavaScriptServices.ViewEngine.Http.XmlConfigurationReader.GetById(String id)
at Sitecore.JavaScriptServices.ViewEngine.Http.RenderEngineOptionsResolver.ResolveForId(String id, RenderEngineOptions runtimeOptions)
at Sitecore.JavaScriptServices.ViewEngine.Http.HttpRenderEngineFactory.CreateEngine(RenderEngineOptions options)
at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.ResolveRenderEngine()
at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.Render(TextWriter writer)
at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
I have verified scconfig
and other configs like .env
and config under sitecore/config in next js app. Everything is fine. Do anyone faced such issue and how resolved such issue?