diff --git a/packages/gatsby-transformer-remark/src/extend-node-type.js b/packages/gatsby-transformer-remark/src/extend-node-type.js index ec8c366269378..c29b8cc7fa4f7 100644 --- a/packages/gatsby-transformer-remark/src/extend-node-type.js +++ b/packages/gatsby-transformer-remark/src/extend-node-type.js @@ -364,7 +364,8 @@ module.exports = function remarkExtendNodeType( } async function getHTMLAst(markdownNode) { - const cachedAst = await cache.get(htmlAstCacheKey(markdownNode)) + const key = htmlAstCacheKey(markdownNode) + const cachedAst = await cache.get(key) if (cachedAst) { return cachedAst } else { @@ -372,7 +373,7 @@ module.exports = function remarkExtendNodeType( const htmlAst = markdownASTToHTMLAst(ast) // Save new HTML AST to cache and return - await cache.set(htmlAstCacheKey(markdownNode), htmlAst) + await cache.set(key, htmlAst) return htmlAst } }