alphagov / govuk_publishing_components

A gem to document and distribute frontend components for GOV.UK applications
https://components.publishing.service.gov.uk
MIT License
66 stars 20 forks source link

Navigation header doesn't finish rendering if JS errors #2367

Closed andysellick closed 3 years ago

andysellick commented 3 years ago

Spotted this while developing locally with government-frontend. I'd broken the scroll tracking JavaScript and when the page rendered it looked like this:

Screenshot 2021-10-15 at 09 29 26

This was in development and hopefully we'd catch any obvious JS errors like this before going to production, but it's always possible that a JS error like this could occur for another reason (we get loads of JS errors in LUX which seem to be due to things like conflicts with browser extensions, or if someone's connection dies mid-download, for example).

(apologies for the nebulous 'this might break bye' issue, but I thought it would be worth recording edge cases like this)

chao-xian commented 3 years ago

Tracking on https://trello.com/c/8SJjpii5/578-header-doesnt-finish-rendering-if-js-errors

injms commented 3 years ago

Just to make sure that this isn't missed, this concerns the navigation header component.

injms commented 3 years ago

We found that this has been fixed in https://github.com/alphagov/govuk_publishing_components/pull/2388.

Separately, I'm going to see if there could be further improvements to the way this component loads and initialises.