diff --git a/packages/sui-ssr/server/initialContextValue/index.js b/packages/sui-ssr/server/initialContextValue/index.js index 1f0bdfa71..2604094dc 100644 --- a/packages/sui-ssr/server/initialContextValue/index.js +++ b/packages/sui-ssr/server/initialContextValue/index.js @@ -15,7 +15,7 @@ export const INITIAL_CONTEXT_VALUE = '__INITIAL_CONTEXT_VALUE__' export const getInitialContextValue = context => Object.keys(context) .filter( - contextKey => typeof context[contextKey].getInitialData === 'function' + contextKey => typeof context[contextKey]?.getInitialData === 'function' ) .reduce((acc, contextKey) => { acc[contextKey] = context[contextKey].getInitialData()