Closed eggsyntax closed 11 months ago
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).
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 fn
s 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
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
The root cause is incorrect usage of Highlight.js
- in https://github.com/highlightjs/highlight.js/pull/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:
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)[: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.
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.
Added new highlighting that doesn't depend on highlight.js. No more react bugs.
Thanks, it's appreciated!
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:
Happy to answer any questions I can!
Screencap in case that's helpful:
https://user-images.githubusercontent.com/1233514/182452089-8dd05692-78f2-4147-b9e6-47a6626b5e1d.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