Blazor- Navigation bar not working (Single navigation bar)

happyhappyWith your Startkit blazor demo

i create new menu item (single menu) counter and set page href="/counter" for menu-link. when i click on the link it gives below error and menu behavior working stopped

error detail
[2022-11-23T12:22:02.746Z] Error: Microsoft.JSInterop.JSException: Cannot read properties of undefined (reading 'closest')
TypeError: Cannot read properties of undefined (reading 'closest')
at _getItemParentElement (http://localhost:5170/assets/js/scripts.bundle.js:2439:24)
at _getItemParentElements (http://localhost:5170/assets/js/scripts.bundle.js:2460:22)
at _setActiveLink (http://localhost:5170/assets/js/scripts.bundle.js:2752:27)
at KTMenu.the.setActiveLink (http://localhost:5170/assets/js/scripts.bundle.js:2907:16)
at KTMenu.updateByLinkAttribute (http://localhost:5170/assets/js/scripts.bundle.js:3158:26)
at http://localhost:5170/_framework/blazor.server.js:1:3501
at new Promise ()
at kt.beginInvokeJSFromDotNet (http://localhost:5170/_framework/blazor.server.js:1:3475)
at http://localhost:5170/_framework/blazor.server.js:1:72077
at Array.forEach ()
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Starterkit.Shared.MasterInit.OnLocationChanged(Object sender, LocationChangedEventArgs args) in C:\Development_Stuff\Metronic\metronic_blazor_v8.1.5_demo1\blazor_demo1\Starterkit\Shared\MasterInit.razor:line 38
at System.Threading.Tasks.Task.c.b__128_0(Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.c.b__23_0(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

Hi,

Could you please attach the code of your menu element?

Regards,
Lauris Stepanovs,
Keenthemes Support Team

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(