diff --git a/packages/gatsby/cache-dir/production-app.js b/packages/gatsby/cache-dir/production-app.js index 12864999ba9f8..2a8b04e890ac6 100644 --- a/packages/gatsby/cache-dir/production-app.js +++ b/packages/gatsby/cache-dir/production-app.js @@ -12,6 +12,7 @@ import history from "./history" window.___history = history import emitter from "./emitter" window.___emitter = emitter +import shallowCompare from "shallow-compare" import pages from "./pages.json" import redirects from "./redirects.json" import ComponentRenderer from "./component-renderer" @@ -62,8 +63,8 @@ apiRunnerAsync(`onClientEntry`).then(() => { pathname = redirect.toPath } - // If we're already at this path, do nothing. - if (window.location.pathname === pathname) { + // If we're already at this location, do nothing. + if (shallowCompare(window.location, location)) { return }