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)))