Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Theme builder
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2025 at 06:52 UTC
Updated:
10 May 2025 at 14:44 UTC
Jump to comment: Most recent

Comments
Comment #2
wim leersI have no idea how to reproduce this, but I do see this is a dependency. Hopefully @balintbrews can tie the code to the exception and determine steps to reproduce?
Comment #3
balintbrewsThis is the one error that's been hunting me, because I don't know what causes it and how to reproduce. I've seen it occasionally, but I never had time to dig into it. All I know is that it comes from
react-mosaic. Any ideas, @hooroomoo?Comment #4
lauriiiI do not have steps to reproduce for this but this is something I've been running into quite frequently today. It might warrant some investigation.
Comment #5
balintbrewsI don't have the exact steps to reproduce, but I may have an understanding of why this error occurs.
react-mosaicusesreact-dndfor its drag & drop functionality. TheMosaiccomponent wraps its logic in theDndProviderfromreact-dnd. I believe the problem we're seeing is that when we switch between routes, that context provider sometimes can't fully unmount itself before the new provider starts mounting itself on the new route. The solution is to decoupleDndProviderfrom where we use theMosaiccomponent. Luckily,react-mosaicexportsMosaicWithoutDragDropContextfor us to do that.So I'm adding
react-dnd,rdndmb-html5-to-touch, andreact-dnd-multi-backendas explicit dependencies — they were already indirectly added byreact-mosaic— and wrapping everything in the context provider inApp.tsx, so we can replace our use of theMosaiccomponent withMosaicWithoutDragDropContext. The provider then remains stable while switching between routes.I developed this assumption based on https://github.com/nomcopter/react-mosaic/issues/162.
This is all just theory, as I don't have a way to reproduce the error. Let's thoroughly test that the new context provider doesn't cause issues with our other drag & drop library, dnd kit, which also wraps most of the component tree in a context provider. Yes, ideally we would only use one, but this was so far an implementation detail of
react-mosaic, and we already heavily based our content preview canvas interactions heavily on dnd kit.For future consideration, I opened #3520994: Move away from react-mosaic for the code editor UI.
Comment #7
balintbrewsComment #8
hooroomooI pulled this down and tried to reproduce the error by switching the routes consecutively but couldn't.
@balintbrews theory is very solid and the code is well commented so I think it makes sense to get this in and see if it solves the issue on 0.x since there are no exact steps to reproduce it.
Comment #10
balintbrewsComment #11
balintbrews