From 12a34647b958140d69b83b607739ed829895c606 Mon Sep 17 00:00:00 2001 From: Julien Blatecky Date: Thu, 13 Jun 2019 19:42:07 +0200 Subject: [PATCH] Fix missing tracking code in rendered HTML `onRenderBody` does take any return type, I removed the useless `return null` at the end of this function. `setHeadComponents` doesn't return anything so the right side of the `&&` wasn't executed, only the `head` was built. --- src/gatsby-ssr.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gatsby-ssr.js b/src/gatsby-ssr.js index 20e3fad..dbaff2c 100644 --- a/src/gatsby-ssr.js +++ b/src/gatsby-ssr.js @@ -85,13 +85,10 @@ exports.onRenderBody = ( (process.env.NODE_ENV === 'production' || pluginOptions.dev === true) && !isPathExcluded ) { - return ( - setHeadComponents([buildHead(pluginOptions)]) && - setPostBodyComponents([ - buildTrackingCode(pluginOptions), - buildTrackingCodeNoJs(pluginOptions, pathname) - ]) - ) + setHeadComponents([buildHead(pluginOptions)]) + setPostBodyComponents([ + buildTrackingCode(pluginOptions), + buildTrackingCodeNoJs(pluginOptions, pathname) + ]) } - return null }