katalyst / kpop

MIT License
5 stars 1 forks source link

Missing outlet element "scrim" for host controller "kpop--frame" #58

Open sfnelson opened 2 months ago

sfnelson commented 2 months ago

Seeing a missing outlet error in kpop when testing katalyst/content using morph. Steps to reproduce:

  1. Starting with a published, empty page
  2. Add a section without saving
  3. Add another section and "discard" from the modal.
Error: Missing outlet element "scrim" for host controller "kpop--frame". Stimulus couldn't find a matching outlet element using selector "#scrim".
    at t.get (stimulus.min-4b1e420e.js:4:44317)
    at t.clear (kpop-b9b5f5da.js:335:19)
    at t.connect (kpop-b9b5f5da.js:267:12)
    at L.connect (stimulus.min-4b1e420e.js:4:26905)
    at j.connectContextForScope (stimulus.min-4b1e420e.js:4:29697)
    at H.scopeConnected (stimulus.min-4b1e420e.js:4:36978)
    at J.elementMatchedValue (stimulus.min-4b1e420e.js:4:35147)
    at F.tokenMatched (stimulus.min-4b1e420e.js:4:15098)
    at N.tokenMatched (stimulus.min-4b1e420e.js:4:13795)
    at stimulus.min-4b1e420e.js:4:13689

The error seems to indicated that the outlet has previously connected but has now disappeared. I wonder if this could be a consequence of morphing, i.e. the issue I reported to stimulus about outlets not firing disconnect events on morph.

It might be possible to change to using hasOutlet, but I'm not sure. My best idea is to enable morph for the kpop tests and see if anything shows up. Unfortunately this likely means we need to duplicate the tests for with/without morph.