From 253a1d6a885f0e8889749c466934ca8fedf5d3ec Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Mon, 1 Mar 2021 11:38:23 +0100 Subject: [PATCH] fix(gatsby-plugin-preact): fix fast-refresh (#29831) (cherry picked from commit 81a377650e267b930482abf647053b1a0b6bc384) --- packages/gatsby/cache-dir/fast-refresh-overlay/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby/cache-dir/fast-refresh-overlay/index.js b/packages/gatsby/cache-dir/fast-refresh-overlay/index.js index f00008be01034..b8253a129a8b3 100644 --- a/packages/gatsby/cache-dir/fast-refresh-overlay/index.js +++ b/packages/gatsby/cache-dir/fast-refresh-overlay/index.js @@ -54,7 +54,7 @@ function DevOverlay({ children }) { const [state, dispatch] = React.useReducer(reducer, initialState) React.useEffect(() => { - const gatsbyEvents = window._gatsbyEvents + const gatsbyEvents = window._gatsbyEvents || [] window._gatsbyEvents = { push: ([channel, event]) => { if (channel === `FAST_REFRESH`) {