From 6d8cf68b451cba5fc3586cba48ad2fe49faa5d10 Mon Sep 17 00:00:00 2001 From: Eric Eldredge Date: Tue, 12 Mar 2019 17:28:00 -0400 Subject: [PATCH] fix(docz-core): initialize config state on data server start In a project with no docz config files, (for example, in a gatsby app using gatsby-theme-docz with config only in gatsby-config.js), the config state is not initialized, which causes errors when the config state is read. --- core/docz-core/src/states/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/docz-core/src/states/config.ts b/core/docz-core/src/states/config.ts index 403b1f802..aeb0cb5e3 100644 --- a/core/docz-core/src/states/config.ts +++ b/core/docz-core/src/states/config.ts @@ -56,7 +56,7 @@ export const state = (config: Config): State => { id: 'config', start: async params => { const fn = async () => update(params, initial) - + await update(params, initial) watcher.on('add', fn) watcher.on('change', fn) watcher.on('unlink', fn)