Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Mousing over events tab causes panel to crash #376

Closed
eggsyntax opened this issue Aug 2, 2022 · 8 comments
Closed

[Bug]: Mousing over events tab causes panel to crash #376

eggsyntax opened this issue Aug 2, 2022 · 8 comments
Assignees

Comments

@eggsyntax
Copy link

eggsyntax commented Aug 2, 2022

What happened?

This issue may be related to #346, but a) the error message is different, and b) I'm using shadow-cljs rather than any version of figwheel.

If I open the 10x panel to the Events tab, and then move the mouse up and down between the fn-traced and the lower part, the panel crashes and disappears, leaving errors in the JS console.

Some things that didn't solve it:

  • Excluding highlight.js and requiring an updated version via cljsjs
  • Excluding highlight.js and requiring an updated version via package.json
  • Removing our package.json require of highlight.js entirely (we need to require it for unrelated purposes, and do so at version 11.1.0)
  • Excluding highlight.js and requiring an older version
  • Excluding re-highlight and requiring the latest version
  • Various combinations of the above

Happy to answer any questions I can!

Screencap in case that's helpful:

Screen.Recording.2022-08-02.at.2.54.52.PM.mov

Thanks to all for your work on 10x <3

10x Version

1.4.1

Reagent Version

1.1.0

React Version

^16.14.0

re-frame Version

1.2.0

What browsers are you seeing the problem on?

Firefox, Chrome

Relevant console output

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at unmountHostComponents (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:424:401)
    at commitMutationEffects (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:499:400)
    at HTMLUnknownElement.callCallback (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:553:362)
    at Object.invokeGuardedCallbackImpl (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:555:431)
    at invokeGuardedCallback (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:3:132)
    at commitRootImpl (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:487:148)
    at exports.unstable_runWithPriority (http://localhost:3000/js/cljs-runtime/module$node_modules$scheduler$cjs$scheduler_development.js:19:363)
    at runWithPriority$1 (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:130:474)
    at commitRoot (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:479:104)
    at performSyncWorkOnRoot (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:456:165)
unmountHostComponents @ react-dom.development.js:7602
commitMutationEffects @ react-dom.development.js:20501
callCallback @ react-dom.development.js:189
invokeGuardedCallbackImpl @ react-dom.development.js:238
invokeGuardedCallback @ react-dom.development.js:293
commitRootImpl @ react-dom.development.js:22510
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
commitRoot @ react-dom.development.js:22382
performSyncWorkOnRoot @ react-dom.development.js:21808
eval @ react-dom.development.js:11090
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
flushSyncCallbackQueueImpl @ react-dom.development.js:11085
flushSyncCallbackQueue @ react-dom.development.js:11073
scheduleWork @ react-dom.development.js:21200
enqueueForceUpdate @ react-dom.development.js:12679
Component.forceUpdate @ react.development.js:491
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$run_queue @ batching.cljs:39
eval @ batching.cljs:88
eval @ batching.cljs:98
eval @ batching.cljs:78
G__64039 @ batching.cljs:59
requestAnimationFrame (async)
eval @ batching.cljs:59
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$schedule @ batching.cljs:125
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$rea_enqueue @ ratom.cljs:122
eval @ ratom.cljs:401
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$handle_reaction_change @ ratom.cljs:347
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$notify_w @ ratom.cljs:106
eval @ ratom.cljs:148
cljs$core$_reset_BANG_ @ core.cljs:866
cljs$core$reset_BANG_ @ core.cljs:4527
eval @ fx.cljc:185
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$fx$do_fx_after @ fx.cljc:56
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$events$handle @ events.cljc:65
eval @ router.cljc:179
eval @ router.cljc:198
eval @ router.cljc:146
eval @ router.cljc:169
G__64937 @ router.cljc:187
channel.port1.onmessage @ nexttick.js:196

react-dom.development.js:19528 The above error occurred in one of your React components:
    in code (created by re_highlight.core.render)
    in pre (created by re_highlight.core.render)
    in re_highlight.core.render (created by re_highlight.core.highlight)
    in re_highlight.core.highlight (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by code)
    in code (created by day8.re_frame_10x.panels.event.views.code)
    in day8.re_frame_10x.panels.event.views.code (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.panels.event.views.panel)
    in day8.re_frame_10x.panels.event.views.panel (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.navigation.views.tab_content)
    in day8.re_frame_10x.navigation.views.tab_content (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in day8.re_frame_10x.components.re_com.v_split (created by day8.re_frame_10x.navigation.views.devtools_inner)
    in day8.re_frame_10x.navigation.views.devtools_inner (created by day8.re_frame_10x.components.re_com.h_box)
    in div (created by day8.re_frame_10x.components.re_com.h_box)
    in day8.re_frame_10x.components.re_com.h_box (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by devtools outer)
    in devtools outer (created by day8.re_frame_10x.devtools_outer)
    in day8.re_frame_10x.devtools_outer (created by day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container)
    in day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:19528
logError @ react-dom.development.js:19565
expirationTime.callback @ react-dom.development.js:20709
commitUpdateQueue @ react-dom.development.js:12491
commitLifeCycles @ react-dom.development.js:19884
commitLayoutEffects @ react-dom.development.js:22804
callCallback @ react-dom.development.js:189
invokeGuardedCallbackImpl @ react-dom.development.js:238
invokeGuardedCallback @ react-dom.development.js:293
commitRootImpl @ react-dom.development.js:22542
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
commitRoot @ react-dom.development.js:22382
performSyncWorkOnRoot @ react-dom.development.js:21808
eval @ react-dom.development.js:11090
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
flushSyncCallbackQueueImpl @ react-dom.development.js:11085
flushSyncCallbackQueue @ react-dom.development.js:11073
scheduleWork @ react-dom.development.js:21200
enqueueForceUpdate @ react-dom.development.js:12679
Component.forceUpdate @ react.development.js:491
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$run_queue @ batching.cljs:39
eval @ batching.cljs:88
eval @ batching.cljs:98
eval @ batching.cljs:78
G__64039 @ batching.cljs:59
requestAnimationFrame (async)
eval @ batching.cljs:59
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$schedule @ batching.cljs:125
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$rea_enqueue @ ratom.cljs:122
eval @ ratom.cljs:401
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$handle_reaction_change @ ratom.cljs:347
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$notify_w @ ratom.cljs:106
eval @ ratom.cljs:148
cljs$core$_reset_BANG_ @ core.cljs:866
cljs$core$reset_BANG_ @ core.cljs:4527
eval @ fx.cljc:185
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$fx$do_fx_after @ fx.cljc:56
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$events$handle @ events.cljc:65
eval @ router.cljc:179
eval @ router.cljc:198
eval @ router.cljc:146
eval @ router.cljc:169
G__64937 @ router.cljc:187
channel.port1.onmessage @ nexttick.js:196

react-dom.development.js:19528 The above error occurred in the <span> component:
    in span (created by re_highlight.core.render)
    in code (created by re_highlight.core.render)
    in pre (created by re_highlight.core.render)
    in re_highlight.core.render (created by re_highlight.core.highlight)
    in re_highlight.core.highlight (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by code)
    in code (created by day8.re_frame_10x.panels.event.views.code)
    in day8.re_frame_10x.panels.event.views.code (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.panels.event.views.panel)
    in day8.re_frame_10x.panels.event.views.panel (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.navigation.views.tab_content)
    in day8.re_frame_10x.navigation.views.tab_content (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in day8.re_frame_10x.components.re_com.v_split (created by day8.re_frame_10x.navigation.views.devtools_inner)
    in day8.re_frame_10x.navigation.views.devtools_inner (created by day8.re_frame_10x.components.re_com.h_box)
    in div (created by day8.re_frame_10x.components.re_com.h_box)
    in day8.re_frame_10x.components.re_com.h_box (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by devtools outer)
    in devtools outer (created by day8.re_frame_10x.devtools_outer)
    in day8.re_frame_10x.devtools_outer (created by day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container)
    in day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:19528
logError @ react-dom.development.js:19565
expirationTime.callback @ react-dom.development.js:20709
commitUpdateQueue @ react-dom.development.js:12491
commitLifeCycles @ react-dom.development.js:19884
commitLayoutEffects @ react-dom.development.js:22804
callCallback @ react-dom.development.js:189
invokeGuardedCallbackImpl @ react-dom.development.js:238
invokeGuardedCallback @ react-dom.development.js:293
commitRootImpl @ react-dom.development.js:22542
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
commitRoot @ react-dom.development.js:22382
performSyncWorkOnRoot @ react-dom.development.js:21808
eval @ react-dom.development.js:11090
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
flushSyncCallbackQueueImpl @ react-dom.development.js:11085
flushSyncCallbackQueue @ react-dom.development.js:11073
scheduleWork @ react-dom.development.js:21200
enqueueForceUpdate @ react-dom.development.js:12679
Component.forceUpdate @ react.development.js:491
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$run_queue @ batching.cljs:39
eval @ batching.cljs:88
eval @ batching.cljs:98
eval @ batching.cljs:78
G__64039 @ batching.cljs:59
requestAnimationFrame (async)
eval @ batching.cljs:59
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$schedule @ batching.cljs:125
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$rea_enqueue @ ratom.cljs:122
eval @ ratom.cljs:401
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$handle_reaction_change @ ratom.cljs:347
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$notify_w @ ratom.cljs:106
eval @ ratom.cljs:148
cljs$core$_reset_BANG_ @ core.cljs:866
cljs$core$reset_BANG_ @ core.cljs:4527
eval @ fx.cljc:185
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$fx$do_fx_after @ fx.cljc:56
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$events$handle @ events.cljc:65
eval @ router.cljc:179
eval @ router.cljc:198
eval @ router.cljc:146
eval @ router.cljc:169
G__64937 @ router.cljc:187
channel.port1.onmessage @ nexttick.js:196

react-dom.development.js:19528 The above error occurred in one of your React components:
    in code (created by re_highlight.core.render)
    in pre (created by re_highlight.core.render)
    in re_highlight.core.render (created by re_highlight.core.highlight)
    in re_highlight.core.highlight (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by code)
    in code (created by day8.re_frame_10x.panels.event.views.code)
    in day8.re_frame_10x.panels.event.views.code (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.panels.event.views.panel)
    in day8.re_frame_10x.panels.event.views.panel (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.navigation.views.tab_content)
    in day8.re_frame_10x.navigation.views.tab_content (created by day8.re_frame_10x.components.re_com.v_box)
    in div (created by day8.re_frame_10x.components.re_com.v_box)
    in day8.re_frame_10x.components.re_com.v_box (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in div (created by day8.re_frame_10x.components.re_com.v_split)
    in day8.re_frame_10x.components.re_com.v_split (created by day8.re_frame_10x.navigation.views.devtools_inner)
    in day8.re_frame_10x.navigation.views.devtools_inner (created by day8.re_frame_10x.components.re_com.h_box)
    in div (created by day8.re_frame_10x.components.re_com.h_box)
    in day8.re_frame_10x.components.re_com.h_box (created by day8.re_frame_10x.components.re_com.box)
    in div (created by day8.re_frame_10x.components.re_com.box)
    in day8.re_frame_10x.components.re_com.box (created by devtools outer)
    in devtools outer (created by day8.re_frame_10x.devtools_outer)
    in day8.re_frame_10x.devtools_outer (created by day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container)
    in day8.re_frame_10x.inlined_deps.spade.git_sha_93ef290.react.with_style_container

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:19528
logError @ react-dom.development.js:19565
expirationTime.callback @ react-dom.development.js:20709
commitUpdateQueue @ react-dom.development.js:12491
commitLifeCycles @ react-dom.development.js:19884
commitLayoutEffects @ react-dom.development.js:22804
callCallback @ react-dom.development.js:189
invokeGuardedCallbackImpl @ react-dom.development.js:238
invokeGuardedCallback @ react-dom.development.js:293
commitRootImpl @ react-dom.development.js:22542
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
commitRoot @ react-dom.development.js:22382
performSyncWorkOnRoot @ react-dom.development.js:21808
eval @ react-dom.development.js:11090
exports.unstable_runWithPriority @ scheduler.development.js:654
runWithPriority$1 @ react-dom.development.js:11040
flushSyncCallbackQueueImpl @ react-dom.development.js:11085
flushSyncCallbackQueue @ react-dom.development.js:11073
scheduleWork @ react-dom.development.js:21200
enqueueForceUpdate @ react-dom.development.js:12679
Component.forceUpdate @ react.development.js:491
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$run_queue @ batching.cljs:39
eval @ batching.cljs:88
eval @ batching.cljs:98
eval @ batching.cljs:78
G__64039 @ batching.cljs:59
requestAnimationFrame (async)
eval @ batching.cljs:59
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$schedule @ batching.cljs:125
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$rea_enqueue @ ratom.cljs:122
eval @ ratom.cljs:401
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$handle_reaction_change @ ratom.cljs:347
day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$ratom$notify_w @ ratom.cljs:106
eval @ ratom.cljs:148
cljs$core$_reset_BANG_ @ core.cljs:866
cljs$core$reset_BANG_ @ core.cljs:4527
eval @ fx.cljc:185
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$fx$do_fx_after @ fx.cljc:56
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptor_fn @ interceptor.cljc:70
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$invoke_interceptors @ interceptor.cljc:108
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$interceptor$execute @ interceptor.cljc:201
day8$re_frame_10x$inlined_deps$re_frame$v1v1v2$re_frame$events$handle @ events.cljc:65
eval @ router.cljc:179
eval @ router.cljc:198
eval @ router.cljc:146
eval @ router.cljc:169
G__64937 @ router.cljc:187
channel.port1.onmessage @ nexttick.js:196

react-dom.development.js:11103 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at unmountHostComponents (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:424:401)
    at commitMutationEffects (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:499:400)
    at HTMLUnknownElement.callCallback (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:553:362)
    at Object.invokeGuardedCallbackImpl (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:555:431)
    at invokeGuardedCallback (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:3:132)
    at commitRootImpl (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:487:148)
    at exports.unstable_runWithPriority (http://localhost:3000/js/cljs-runtime/module$node_modules$scheduler$cjs$scheduler_development.js:19:363)
    at runWithPriority$1 (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:130:474)
    at commitRoot (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:479:104)
    at performSyncWorkOnRoot (http://localhost:3000/js/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:456:165)
@eggsyntax eggsyntax added the bug label Aug 2, 2022
@eggsyntax
Copy link
Author

Update: confirmed that downgrading 10x to 1.3.0 solves the problem; I'll just go with that for now on our project (but happy to test other solutions if/when that would be helpful).

@eggsyntax
Copy link
Author

eggsyntax commented Aug 3, 2022

Update 2: created a minimal-ish repro by creating a project with

lein new luminus crash10x +shadow-cljs +cljs +re-frame

and removing re-frisk from the project, adding preloads etc for 10x, and changing the event fns to fn-traced so there'd be something present in the Events tab. Should have made an initial commit after the creation with luminus but didn't think to at the time, apologies.

That's here: https://github.com/eggsyntax/crash10x

@hipitihop
Copy link
Contributor

I have found the same issue:
Environment

re-frame-10x:     1.5.0
Linux Ubuntu:     22.04.x
Chrome:           105.0.5195.125 (Official Build) (64-bit)
re-frame:         1.3.0
devtools:         1.0.6
highlight.js:     11.6.0

@p-himik
Copy link
Contributor

p-himik commented Feb 19, 2023

The root cause is incorrect usage of Highlight.js - in highlightjs/highlight.js#3057 they effectively removed undocumented ability to highlight children elements by calling highlightElement in their common parent. And it seems that that ability have never really been there in the first place - I tried rolling back to multiple versions of Highlight.js, all the way to 10.7 (apparently the smallest version where the API required by re-frame-10x is supported), to no avail.

It seems to me that a proper fix would be to:

  1. Incorporate re-highlight into re-frame-10x because IMO changes required for a fix go beyond the scope of re-highlight (and seems that that library was created specifically for re-frame-10x in the first place - not sure why those trivial 15 lines weren't written within re-frame-10x in the first place; I'm also not sure why it sets the non-public called property - it doesn't seem like it should do anything at all in the versions of Highlight.js that have the required API)
  2. Rewrite this block in such a way so that it's still in the same [:pre [:code ...]] but highlightElement is called on each child separately (of course, each child will have to be wrapped in a span)

Alternatively, the scope of re-highlight could be expanded so it supports highlighting within highlighting, and then hljs-compatible? could be removed - it should be completely opaque to re-frame-10x whether the right version is used or not.

kimo-k added a commit that referenced this issue Jul 3, 2023
Some kind of impedance mismatch between react and highlight.js is
causing a crash.

Disabled this for now. Everything works again, just without
highlighted code.

I'm still considering whether to fix re-highlight, or find something
simpler to replace it.

#376
@kimo-k
Copy link
Contributor

kimo-k commented Jul 3, 2023

Disabled syntax highlighting for now, since this crash seems pretty bad.

@p-himik, thanks for the detailed analysis, I'll look into it.

It may be just because I'm new, but re-highlight seems hard to maintain. I'm considering whether to fix re-highlight or replace it with something simpler.

@kimo-k kimo-k self-assigned this Jul 3, 2023
@kimo-k
Copy link
Contributor

kimo-k commented Jul 3, 2023

Both highlighting & crash removed in 1.7.0

kimo-k added a commit that referenced this issue Jul 20, 2023
The highlight.js integration has been costly to maintain, both for
day8 and for our users. See:

#376

Now, we use rewrite-clj and reagent for minimalistic
highlighting. This is similar to borkdude's approach:

https://blog.michielborkent.nl/writing-clojure-highlighter.html

rewrite-clj labels forms by their type and purpose. It provides a
zipper api for expressive traversal, including line & char
numbers.

Now, we simply transform rewrite-clj's node tree into hiccup. We do
two post-order traversals, which isn't ideal, but it works. We could
consolidate the traversal with some careful refactoring.

TODO: ::highlighted-form-bounds is mostly regex math which
reverse-engineers the output of re-frame-debux. Now, ::highlighted?
adds another layer of reverse-engineering. It seems like we could
delete all this calculation, and delete zprint, if re-frame-debux
could simply provide the node tree.

re-frame-debux could also provide some analysis data from clj-kondo,
making it possible to color locals differently from globals, for
instance.
kimo-k added a commit that referenced this issue Jul 20, 2023
The highlight.js integration has been costly to maintain, both for
day8 and for our users. See:

#376

Now, we use rewrite-clj and reagent for minimalistic
highlighting. This is similar to borkdude's approach:

https://blog.michielborkent.nl/writing-clojure-highlighter.html

rewrite-clj labels forms by their type and purpose. It provides a
zipper api for expressive traversal, including line & char
numbers.

Now, we simply transform rewrite-clj's node tree into hiccup. We do
two post-order traversals, which isn't ideal, but it works. We could
consolidate the traversal with some careful refactoring.

TODO: ::highlighted-form-bounds is mostly regex math which
reverse-engineers the output of re-frame-debux. Now, ::highlighted?
adds another layer of reverse-engineering. It seems like we could
delete all this calculation, and delete zprint, if re-frame-debux
could simply provide the node tree.

re-frame-debux could also provide some analysis data from clj-kondo,
making it possible to color locals differently from globals, for
instance.
kimo-k added a commit that referenced this issue Jul 25, 2023
The highlight.js integration has been costly to maintain, both for
day8 and for our users. See:

#376

Now, we use rewrite-clj and reagent for minimalistic
highlighting. This is similar to borkdude's approach:

https://blog.michielborkent.nl/writing-clojure-highlighter.html

rewrite-clj labels forms by their type and purpose. It provides a
zipper api for expressive traversal, including line & char
numbers.

Now, we simply transform rewrite-clj's node tree into hiccup. We do
two post-order traversals, which isn't ideal, but it works. We could
consolidate the traversal with some careful refactoring.

TODO: ::highlighted-form-bounds is mostly regex math which
reverse-engineers the output of re-frame-debux. Now, ::highlighted?
adds another layer of reverse-engineering. It seems like we could
delete all this calculation, and delete zprint, if re-frame-debux
could simply provide the node tree.

re-frame-debux could also provide some analysis data from clj-kondo,
making it possible to color locals differently from globals, for
instance.
kimo-k added a commit that referenced this issue Jul 25, 2023
The highlight.js integration has been costly to maintain, both for
day8 and for our users. See:

#376

Now, we use rewrite-clj and reagent for minimalistic
highlighting. This is similar to borkdude's approach:

https://blog.michielborkent.nl/writing-clojure-highlighter.html

rewrite-clj labels forms by their type and purpose. It provides a
zipper api for expressive traversal, including line & char
numbers.

Now, we simply transform rewrite-clj's node tree into hiccup. We do
two post-order traversals, which isn't ideal, but it works. We could
consolidate the traversal with some careful refactoring.

TODO: ::highlighted-form-bounds is mostly regex math which
reverse-engineers the output of re-frame-debux. Now, ::highlighted?
adds another layer of reverse-engineering. It seems like we could
delete all this calculation, and delete zprint, if re-frame-debux
could simply provide the node tree.

re-frame-debux could also provide some analysis data from clj-kondo,
making it possible to color locals differently from globals, for
instance.
@kimo-k
Copy link
Contributor

kimo-k commented Jul 26, 2023

Added new highlighting that doesn't depend on highlight.js. No more react bugs.

@kimo-k kimo-k closed this as completed Jul 26, 2023
@eggsyntax
Copy link
Author

Thanks, it's appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants