From ed5e5d5119cc759b0027f8a46fdee4238cf22266 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Fri, 21 Dec 2018 10:16:40 -0700 Subject: [PATCH] fix(query-runner): replace .off with .removeListener (#10613) ## Description This fixes a bug introduced in #10593 by replacing the `.off` call with `.removeListener`. `.off` was introduced in Node v10.0.0 as an alias for `.removeListener` (https://github.com/nodejs/node/pull/17156). ## Related Issues Related to #10612 --- .../src/internal-plugins/query-runner/page-query-runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js b/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js index 09aeb7902bf46..1c5bbd048e24b 100644 --- a/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js +++ b/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js @@ -163,7 +163,7 @@ const runQueriesForPathnames = pathnames => { return new Promise(resolve => { const onDrain = () => { - queue.off(`drain`, onDrain) + queue.removeListener(`drain`, onDrain) resolve() } queue.on(`drain`, onDrain)