Bad intermodule interactions: Okapi-Console breaks other UI modules

Description

On March 18th, noticed that clicking "Okapi Console" on http://folio-uidemo.aws.indexdata.com/ made whole UI not working (except Log out). The js error is "Uncaught TypeError: Cannot read property 'pathname' of null". Per slack request from Mike on March 20, create a ticket and assign to him for now.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Mike Taylor April 3, 2017 at 12:24 PM

I tried temporarily removing the Users module from my stripes.config.js to see how it affected the JS console output.

... and here's where it gets really weird ...

The JS warning is exactly the same, even though the Users module is not even loaded.

Mike Taylor April 3, 2017 at 12:18 PM

Note the simple, direct pattern of component containment described by the warning:

  • Root -> Provider -> Router -> MainContainer -> ModuleContainer -> Switch -> Route -> Users.

This is what Root.js in stripes-core does. There are a couple of aberrations in what's reported:

  • <BrowserRouter> gets injected. I assume this is some magic that <Router> does.

  • There is a spare <div> inside <ModuleContainer>, which is the one that ModuleContainer.js makes.

But what's clear is that <Users> in that trace really is the top-level component of ui-users, directly invoked by a <Route> created in stripes-core.

Mike Taylor April 3, 2017 at 12:03 PM

(I renamed this issue to convey its much broader implications.)

Mike Taylor April 3, 2017 at 12:03 PM

It's referring to a component <Users> – but there no component of that name in the Okapi Console. There is such a component (of course) in the Users module, and it does indeed assert in its proptypes validation that the pathname element of the location property is required. But why would loading the Okapi Console touch on this at all?

Stranger still: when starting a new Stripes session that the Okapi Console is part of, I can go to the Users module and it works fine. Only when I go to the Okapi Console is this warning emitted.

Why is the Okapi Console doing anything to the Users module? Why Users and not Items?

Mike Taylor April 3, 2017 at 11:50 AM

Hmm, no, it's weirder than that. HEre is the first of the warnings:

Cannot Reproduce

Details

Assignee

Reporter

Labels

Priority

Development Team

Stripes Force

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created March 20, 2017 at 3:39 PM
Updated March 27, 2019 at 10:32 PM
Resolved March 27, 2019 at 10:32 PM
TestRail: Cases
TestRail: Runs