diff --git a/CHANGELOG.md b/CHANGELOG.md index 999f884219..3878422989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add unit test for `core/modules/checkout` - @psmyrek (#3460) +- Add defense against incomplete config in ssr renderer - @oskar1233 (#3774) - Add unit tests for `core/modules/order` - @dz3n (#3466) ### Fixed diff --git a/core/scripts/utils/ssr-renderer.js b/core/scripts/utils/ssr-renderer.js index 4e1def36e3..b77a6d3b21 100644 --- a/core/scripts/utils/ssr-renderer.js +++ b/core/scripts/utils/ssr-renderer.js @@ -22,7 +22,10 @@ function createRenderer (bundle, clientManifest, template) { } function getFieldsToFilter () { - const fields = [...config.ssr.initialStateFilter, ...config.ssr.lazyHydrateFor] + const fields = [ + ...(config.ssr && (config.ssr.initialStateFilter || [])), + ...(config.ssr && (config.ssr.lazyHydrateFor || [])) + ] return fields }