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

Forcing JS to the head breaks AssetAdmin #1349

Open
p0lar-bear opened this issue Apr 14, 2023 · 1 comment
Open

Forcing JS to the head breaks AssetAdmin #1349

p0lar-bear opened this issue Apr 14, 2023 · 1 comment

Comments

@p0lar-bear
Copy link

p0lar-bear commented Apr 14, 2023

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 had Requirements::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 the registerHandlers function - the value isn't being exported or needed outside of that function.

@sb-relaxt-at
Copy link

sb-relaxt-at commented Jul 16, 2024

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.

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

3 participants