From 592ea50ddeeb9a24e8e80005077b626d72c7949b Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Tue, 22 Aug 2023 15:09:32 +0100 Subject: [PATCH] Update error server with GOV.UK Frontend v5 paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’m aware we have `nunjucksPaths` in **govuk-prototype-kit.config.json** but the error server doesn’t use it --- lib/errorServer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/errorServer.js b/lib/errorServer.js index 6287aadb2d..fd064ad908 100644 --- a/lib/errorServer.js +++ b/lib/errorServer.js @@ -69,7 +69,10 @@ function runErrorServer (error) { try { const nunjucksAppEnv = getNunjucksAppEnv([ path.join(__dirname, 'nunjucks'), - path.join(packageDir, 'node_modules', 'govuk-frontend'), + path.join(packageDir, 'node_modules', 'govuk-frontend', 'dist'), + path.join(process.cwd(), 'node_modules', 'govuk-frontend', 'dist'), + + // Fall back to GOV.UK Frontend legacy search path (without `/dist` suffix) path.join(process.cwd(), 'node_modules', 'govuk-frontend') ]) res.end(nunjucksAppEnv.render('views/error-handling/server-error', getErrorModel(error)))