From 289ca7570da6829b38666ca0bb208d12e1dc733d Mon Sep 17 00:00:00 2001 From: Pedro Nauck Date: Fri, 15 Mar 2019 17:28:12 -0300 Subject: [PATCH] fix(gatsby-theme-docz): throws false for json stringify --- core/gatsby-theme-docz/src/node/sourceNodes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/gatsby-theme-docz/src/node/sourceNodes.js b/core/gatsby-theme-docz/src/node/sourceNodes.js index 3108711a7..e4d4855df 100644 --- a/core/gatsby-theme-docz/src/node/sourceNodes.js +++ b/core/gatsby-theme-docz/src/node/sourceNodes.js @@ -28,12 +28,12 @@ module.exports = async ({ actions, createNodeId }, opts) => { } const createDbNode = async () => { - const db = await fs.readJSON(config.paths.db) - const contentDigest = digest(JSON.stringify(db)) + const db = await fs.readJSON(config.paths.db, { throws: false }) + const contentDigest = digest(JSON.stringify(db || {})) createNode({ id: createNodeId('docz-db'), - db: JSON.stringify(db), + db: JSON.stringify(db || {}), children: [], internal: { contentDigest,