Skip to main content

Hello there!

 

One of our projects is a single page app, which we decided to build with LWR. The app has two levels of navigation, for simplicity let's call them "objects" and "records". Following the guidance in the LWR docs, I created a top level (outer) router for navigating between different objects, and a nested (inner) router for opening records within those objects. The inner page handler is configured with `exact: false` in the outer router for dynamic URL matching (record ids). Client-side navigation is also backed-up by server-side navigation to support reloads, but that is beside the point.

 

The URI format looks like this: /objectName/:recordId, with the recordId being passed via page reference attributes.

 

The issue is that I cannot get past the inner route handler in production mode, even though it works in development mode. The inner router is instantiated but does not open the inner view page.

 

I was able to replicate this issue using the example app described in the LWR documentation. I added navigation buttons to all example pages and logged class constructions and navigation attempts. The last log entry was "Constructed example/animalPageHandler".

 

I enabled stopping on all errors and got an exception navigating from the Home page to the Animal Home page: "Error: Adapter already has a context provider." thrown inside bundle_lwc.js module. This does not happen in development mode! I tried debugging the minified code but to no success.

 

Is that a known issue? Am I doing anything wrong? Is this even the right group to ask such questions?

 

Thank you!

9 answers
  1. Jan 25, 2023, 9:18 PM

    @Aleksei Murashin

     

    I tracked this down to a new bug (thank you!)

     

    For now you can workaround it by adding this to your `lwr.config.json`:

     

        "bundleConfig": {

            "exclude": ["lwr/domRouter"]

        },

0/9000