Skip to content

[18.0][FIX] base_rest: do not crash the frontend boot outside the Swagger page#1

Open
eantones wants to merge 1 commit into
18.0from
18.0-fix-base_rest-swagger-boot-guard
Open

[18.0][FIX] base_rest: do not crash the frontend boot outside the Swagger page#1
eantones wants to merge 1 commit into
18.0from
18.0-fix-base_rest-swagger-boot-guard

Conversation

@eantones

Copy link
Copy Markdown
Member

swagger_ui.js is loaded in web.assets_frontend_lazy, so its whenReady bootstrap runs on every frontend page. Outside the Swagger UI page, document.getElementById("swagger-ui") returns null and the following .getAttribute() throws a TypeError in the browser console on every page load — the login page included.

Guard the bootstrap so it only mounts the component when the element exists. Version bumped for the asset rebuild.

Found during a real 14.0 → 18.0 migration smoke pass (console error on /web/login reproduced with Playwright, gone after the guard).

…gger page

swagger_ui.js rides web.assets_frontend_lazy, so its whenReady bootstrap
runs on every frontend page. Outside the Swagger UI page
document.getElementById("swagger-ui") is null and .getAttribute() throws
a TypeError in the console on every page load (login included). Guard the
bootstrap so it only mounts when the element exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant