We've also had similar issues at a customer, starting with the deploy of the 23H2 CU.
There was an error when trying to preview the theme
, as well as massive (10-15s) delays when navigating between sites (not between same-site pages, because theme loading is site specific), due to a bug throwing Maximum call stack size exceeded
errors.
After some digging, I found a pretty bad recursion bug in sp-pages-assembly.js?uniqueId=pxHxh
, aka the 23H2 version. Specifically, the handling of the new effects
and spacing
theme properties, in the createTheme
and spLoadTheme
functions.
The solution was to patch sp-pages-assembly, adding the effects and spacing props to the default theming object, in addition to the already present palette, fonts, semanticColors, isInverted
and disableGlobalClassNames
props.
I wrote a small powershell script which quick-and-dirty does a find/replace in all sp-pages-assembly.js
files in your 16-hive, which you can use if you want. Run it on all web front ends, and page loading should be a lot quicker in addition to the theme preview working.
PS: Hacking js-files in the 16-hive is bad, and not something anyone should really do. The changes made by the script will be overwritten in the next CU from Microsoft, and by then they'll hopefully have a fix for it themselves.