day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
636 stars 68 forks source link

[Bug]: Pop-out no longer working #410

Closed Kaffeleif closed 10 months ago

Kaffeleif commented 10 months ago

What happened?

When I press the pop-up button I get the following error: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

It seems to fail on line 6 in shadow_dom.cljs (set! (.-adoptedStyleSheets shadow-root) (js/Array. stylesheet))))

Factory Reset

10x Version

1.9.6

Reagent Version

1.0.0

React Version

17.0.1

re-frame Version

1.3.0

What browsers are you seeing the problem on?

No response

Relevant console output

shadow_dom.cljs:6 Uncaught DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed
    at day8$re_frame_10x$tools$shadow_dom$attach_stylesheet (http://localhost:8090/assets/js/dev/day8/re_frame_10x/tools/shadow_dom.js:8:40)
    at day8$re_frame_10x$tools$shadow_dom$shadow_root (http://localhost:8090/assets/js/dev/day8/re_frame_10x/tools/shadow_dom.js:22:54)
    at day8$re_frame_10x$navigation$views$mount (http://localhost:8090/assets/js/dev/day8/re_frame_10x/navigation/views.js:324:66)
    at http://localhost:8090/assets/js/dev/day8/re_frame_10x/navigation/events.js:17:16
    at G__12626__1 (http://localhost:8090/assets/js/dev/cljs/core.js:15587:92)
    at G__12626 (http://localhost:8090/assets/js/dev/cljs/core.js:15627:20)
    at day8$re_frame_10x$fx$window$open_debugger_window (http://localhost:8090/assets/js/dev/day8/re_frame_10x/fx/window.js:51:3)
    at http://localhost:8090/assets/js/dev/day8/re_frame_10x/inlined_deps/re_frame/v1v3v0/re_frame/fx.js:360:17
    at day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$fx$do_fx_after (http://localhost:8090/assets/js/dev/day8/re_frame_10x/inlined_deps/re_frame/v1v3v0/re_frame/fx.js:198:17)
    at day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$invoke_interceptor_fn (http://localhost:8090/assets/js/dev/day8/re_frame_10x/inlined_deps/re_frame/v1v3v0/re_frame/interceptor.js:223:10)
day8$re_frame_10x$tools$shadow_dom$attach_stylesheet @ shadow_dom.cljs:6
day8$re_frame_10x$tools$shadow_dom$shadow_root @ shadow_dom.cljs:18
day8$re_frame_10x$navigation$views$mount @ views.cljs:396
(anonymous) @ events.cljs:14
G__12626__1 @ core.cljs:4413
G__12626 @ core.cljs:4416
day8$re_frame_10x$fx$window$open_debugger_window @ window.cljs:55
(anonymous) @ fx.cljc:116
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$fx$do_fx_after @ fx.cljc:59
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$events$handle @ events.cljc:65
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$router$dispatch_sync @ router.cljc:242
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$core$dispatch_sync @ core.cljc:69
(anonymous) @ views.cljs:277
(anonymous) @ buttons.cljs:23
(anonymous) @ re_com.cljs:447
callCallback @ react-dom.inc.js:3943
invokeGuardedCallbackDev @ react-dom.inc.js:3992
invokeGuardedCallback @ react-dom.inc.js:4054
invokeGuardedCallbackAndCatchFirstError @ react-dom.inc.js:4068
executeDispatch @ react-dom.inc.js:8274
processDispatchQueueItemsInOrder @ react-dom.inc.js:8306
processDispatchQueue @ react-dom.inc.js:8319
dispatchEventsForPlugins @ react-dom.inc.js:8330
(anonymous) @ react-dom.inc.js:8539
batchedEventUpdates$1 @ react-dom.inc.js:22427
batchedEventUpdates @ react-dom.inc.js:3743
dispatchEventForPluginEventSystem @ react-dom.inc.js:8538
attemptToDispatchEvent @ react-dom.inc.js:6036
dispatchEvent @ react-dom.inc.js:5955
unstable_runWithPriority @ react.inc.js:2943
runWithPriority$1 @ react-dom.inc.js:11307
discreteUpdates$1 @ react-dom.inc.js:22444
discreteUpdates @ react-dom.inc.js:3754
dispatchDiscreteEvent @ react-dom.inc.js:5920
load (async)
set @ object.js:148
day8$re_frame_10x$fx$window$open_debugger_window @ window.cljs:54
(anonymous) @ fx.cljc:116
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$fx$do_fx_after @ fx.cljc:59
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$events$handle @ events.cljc:65
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$router$dispatch_sync @ router.cljc:242
day8$re_frame_10x$inlined_deps$re_frame$v1v3v0$re_frame$core$dispatch_sync @ core.cljc:69
(anonymous) @ views.cljs:277
(anonymous) @ buttons.cljs:23
(anonymous) @ re_com.cljs:447
callCallback @ react-dom.inc.js:3943
invokeGuardedCallbackDev @ react-dom.inc.js:3992
invokeGuardedCallback @ react-dom.inc.js:4054
invokeGuardedCallbackAndCatchFirstError @ react-dom.inc.js:4068
executeDispatch @ react-dom.inc.js:8274
processDispatchQueueItemsInOrder @ react-dom.inc.js:8306
processDispatchQueue @ react-dom.inc.js:8319
dispatchEventsForPlugins @ react-dom.inc.js:8330
(anonymous) @ react-dom.inc.js:8539
batchedEventUpdates$1 @ react-dom.inc.js:22427
batchedEventUpdates @ react-dom.inc.js:3743
dispatchEventForPluginEventSystem @ react-dom.inc.js:8538
attemptToDispatchEvent @ react-dom.inc.js:6036
dispatchEvent @ react-dom.inc.js:5955
unstable_runWithPriority @ react.inc.js:2943
runWithPriority$1 @ react-dom.inc.js:11307
discreteUpdates$1 @ react-dom.inc.js:22444
discreteUpdates @ react-dom.inc.js:3754
dispatchDiscreteEvent @ react-dom.inc.js:5920
Kaffeleif commented 10 months ago

Last version where the pop-out works is 1.9.3

kimo-k commented 10 months ago

Hey @Kaffeleif, thanks for the report. This should now be fixed in 1.9.7. Let me know if there's any further breakage.

Kaffeleif commented 10 months ago

Thanks for the quick reply. It works perfectly now :)

scarytom commented 10 months ago

Having upgraded to 1.9.7, I'm getting the following error now:

 Resource: day8/re_frame_10x/navigation/views.cljs:395:34
--------------------------------------------------------------------------------
 392 |   ;; When programming here, we need to be careful about which document and window
 393 |   ;; we are operating on, and keep in mind that the window can close without going
 394 |   ;; through standard react lifecycle, so we hook the beforeunload event.
 395 |   (let [shadow-root              (tools.shadow-dom/shadow-root popup-document "--re-frame-10x--" (inline-resource "day8/re_frame_10x/style.css"))
----------------------------------------^---------------------------------------
 Wrong number of args (3) passed to day8.re-frame-10x.tools.shadow-dom/shadow-root
--------------------------------------------------------------------------------
 396 |         spade-container          (spade.dom/create-container shadow-root)
 397 |         resize-update-scheduled? (atom false)
 398 |         handle-window-resize     (fn [_]
 399 |                                    (when-not @resize-update-scheduled?
--------------------------------------------------------------------------------