From 41c75b29ac90e9edc8d3b7ee7a0545f810ef60ab Mon Sep 17 00:00:00 2001 From: variadicintegrity Date: Thu, 20 Jul 2017 11:20:45 -0500 Subject: [PATCH] Fix unsupported method in IE (#1573) * Fix unsupported method in IE * Fix formatting --- packages/gatsby/src/cache-dir/root.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/gatsby/src/cache-dir/root.js b/packages/gatsby/src/cache-dir/root.js index 3896e9c59e20a..c008cc4932877 100644 --- a/packages/gatsby/src/cache-dir/root.js +++ b/packages/gatsby/src/cache-dir/root.js @@ -53,7 +53,13 @@ function shouldUpdateScroll(prevRouterProps, { location: { pathname } }) { return true } -const noMatch = pages.find(r => r.path === `/dev-404-page/`) +let noMatch +for (let i = 0; i < paths.length; i++) { + if (paths[i].path === `/dev-404-page/`) { + noMatch = paths[i] + break + } +} const addNotFoundRoute = () => { if (noMatch) {