Open p0lar-bear opened 1 year ago
Thanks a lot, I just got the same issue. Error message in the console has been: "Cannot read properties of null (reading 'getAttribute')" Moving the Requirements statement to the PageController#init seems to be a solution.
I recently tried updating a site from earlier in 4.x and found that, after fixing myriad other issues from an outdated app codebase (all my fault and not relevant here), the AssetAdmin view would come up blank. I noticed two errors being thrown in the browser console and investigated.
Line 11 of client/src/boot/registerQueries.js has a bit of a side-effect in that
document.body
is evaluated immediately when the webpack bundle script is loaded. My site config for some long-forgotten reason hadRequirements::set_write_js_to_body(false)
in the config. Because of this, the boot script for AssetAdmin would throw an error and nothing else would happen. Something in the vendor scripts would also do the same.While I was able to fix this by removing that Requirements config call, I feel the better solution here is to move the
isLegacy
definition and assignment to inside of theregisterHandlers
function - the value isn't being exported or needed outside of that function.