Closed colinrotherham closed 1 year ago
To confirm it works, this error is back on Manage prototype pages:
The kit must be running govuk-frontend@4.5.0
internally?
It's fixed on plugin pages which appear to use govuk-frontend@4.7.0
Historically we've tested the isolation by trying scenarios where:
The user has uninstalled Frontend
The case that's most relevant to supporting future versions of Frontend hasn't historically been tested. The way I'm testing this today is:
mkdir ../govuk-frontend
(cd ../govuk-frontend; npm init -y)
npm install ../govuk-frontend
That will install a completely blank govuk-frontend
showing clearly where we expect certain things to exist in the user's version.
In that scenario the kit fails to start both in main
and in error-server-assets
.
In that scenario the kit fails to start both in
main
and inerror-server-assets
.
Happy to accept a challenge, but some of your tests need govuk-frontend
installed
Is running without GOV.UK Frontend entirely more for this one?
Thanks @nataliecarey
Just a reminder that you'll now see GOV.UK Frontend v4.5.0 internally due to --save-exact
Prototype pages using plugin assets won't be affected
Would be good to do another PR to avoid the source map 404 issue https://github.com/alphagov/govuk-prototype-kit/pull/2333#issuecomment-1719458377
This PR fixes a few error page issues
It picks up from changes to isolate GOV.UK Frontend versions in:
Sass variables
The error page Sass
$govuk-assets-path
uses /manage-prototype/dependencies/govuk-frontend but we didn't handle error server responses for this route so fonts and background images were missing:https://github.com/alphagov/govuk-prototype-kit/blob/86fb72a0290af1896dce34472732a778711f6072/lib/assets/sass/manage-prototype.scss#L1
Nunjucks assets
The error page Nunjucks
assetPath
uses /plugin-assets/govuk-frontend which would typically route to a plugin version of GOV.UK Frontend rather than one internal to the Prototype KitThis was handled but with different URLs to the CSS:
https://github.com/alphagov/govuk-prototype-kit/blob/d262239d601e92cc7af138fcf94c7a26172e6bd2/lib/errorServer.js#L59-L61
Sass variables
The error page shares the
manage-prototype.scss
stylesheet which is hard coded to use:https://github.com/alphagov/govuk-prototype-kit/blob/86fb72a0290af1896dce34472732a778711f6072/lib/assets/sass/manage-prototype.scss#L1
HTTP content-type headers
GOV.UK Frontend includes fonts (
*.woff
,*.woff2
), images (*.png
,*.svg
) and favicons (*.ico
)These have now been added to the error server including
*.mjs
with the old-but-newtext/javascript
typehttps://github.com/alphagov/govuk-prototype-kit/blob/86fb72a0290af1896dce34472732a778711f6072/lib/errorServer.js#L27-L30
Legacy GOV.UK Frontend
The Prototype Kit currently patches versions of GOV.UK Frontend prior to v4.4.0 (where
nunjucksMacros
andsass
fields were added to the plugin config) but the$govuk-assets-path
variable was missing leaving the default as: