dmxRouter has stopped my webapp from routing to different pages?

Hey All,

The other day, when saving my main (layout) page i noticed my webapp stopped navigating to any of the pages like it has been for over a year now :slight_smile:

It was changing the address in teh browser address bar but nothing changed and it didn’t change pages.

I noticed through the git changes that Wappler had added this script into the main page:

<script src="/dmxAppConnect/dmxRouting/dmxRouting.js" defer=""></script>

Removing this script fixed the problem, but everytime i save the main page, it adds it back into the head.

My project is set up as a node JS SPA and up until recently has worked fine.

Can someone help shed some light on this or if its a bug?

I have regenerated the Routing Rules in the routing tab, but that didn’t change anything.

My set-up is 1 main layout page and all the other pages are set up as ‘Content Pages’ with the ‘main’ page as their layout.

Any input greatly appreciated.

Cheers,
Phil

The dmxRouting.js file contains the code for navigating and partial updating SPA pages. Instead of a browser navigation it only updates the location and then does a partial load of the page. I don’t know why it wasn’t on your page before when you are using SPA pages.

Can you see anything in devtools, some errors or did it try to load the page via ajax and that failed. Or perhaps it did load successful but it didn’t update the page with the new content. Does your main layout have the View component on it?

<div is="dmx-view" id="content">
  <%- await include(content, locals); %>
</div>

Hey @patrick

Thank you… this fixed the issue. My ‘view’ section was missing the ‘is=dmx-view’

I had:

<section id="content">
                <%- await include(content, locals); %>
            </section>

And now i’ve changed it to:

<section id="content" is="dmx-view">
                <%- await include(content, locals); %>
            </section>

This has also fixed the issue where it seemed to be doing a full page reload with navigation rather than just the content… i was saving that issue for another day but it’s been fixed with this.

Brilliant, thanks!