Try our conversational search powered by Generative AI!

Content not found error on CatalogRouteHelper.MapDefaultHierarchialRouter



We have an initialization module which makes the following call to configure the commerce routing:

         CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, false);

But it's blowing up with the following error:

[ContentNotFoundException: Content with id -1073741823__CatalogContent was not found]
   EPiServer.Core.DefaultContentLoader.Get(ContentReference contentLink, LoaderOptions loaderOptions) +622
   EPiServer.Commerce.Routing.CatalogRouteHelper.MapDefaultHierarchialRouter(RouteCollection routes, Func`1 startingPoint, Boolean enableOutgoingSeoUri) +289
   Braun.Web.Business.Initialization.FindCommerceInitializationModule.Initialize(InitializationEngine context) in C:\Dev\Git\braun\src\Braun.Web\Business\Initialization\FindCommerceInitializationModule.cs:55
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +56
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +348

This suggests that the content loader isn't yet available, however the init module already has a module dependency:

    public class FindCommerceInitializationModule : IConfigurableModule

Any idea what could be going wrong?


Aug 16, 2016 12:58


This was registered as a bug  and was fixed in Commerce. It's likely to be released in Commerce 9.22 - so I would suggest you to upgrade to that version when it comes out. 



Aug 16, 2016 13:38

OK will do. 

Edited, Aug 17, 2016 11:21
<p>Hi,</p> <p>My bad, it was mistaken this with another bug - the stacktrace was very similiar.&nbsp;</p> <p>I suspect that your initialization module is executed too soon - instead of&nbsp;InitializationModule, you should set the ModuleDependency to</p> <pre><span>[</span><span>ModuleDependency</span><span>(</span><span>typeof</span><span>(</span>EPiServer<span>.</span>Commerce<span>.</span>Initialization<span>.</span><span>InitializationModule</span><span>)</span><span>)</span><span>]</span> </pre>
Aug 17, 2016 11:35

Yes, that fixed it - thanks

Aug 17, 2016 12:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.