From 8b4a7e237b728ecff8b37775125af8498724d169 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 26 May 2020 16:00:01 +0200 Subject: [PATCH] FIX lockfile && safety check for window --- lib/client-logger/src/index.ts | 6 ++++-- yarn.lock | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/client-logger/src/index.ts b/lib/client-logger/src/index.ts index 6b180105504..6dedb9df499 100644 --- a/lib/client-logger/src/index.ts +++ b/lib/client-logger/src/index.ts @@ -14,8 +14,10 @@ if (LOGLEVEL) { console.setLevel(LOGLEVEL); } -// eslint-disable-next-line no-underscore-dangle -window.__STORYBOOK_LOGGER = console; +if (window) { + // eslint-disable-next-line no-underscore-dangle + window.__STORYBOOK_LOGGER = console; +} export const pretty = (type: 'trace' | 'debug' | 'info' | 'warn' | 'error') => ( ...args: string[] diff --git a/yarn.lock b/yarn.lock index a608e008471..e96b3b960a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21656,11 +21656,7 @@ loglevel-plugin-prefix@^0.8.4: resolved "https://registry.yarnpkg.com/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz#2fe0e05f1a820317d98d8c123e634c1bd84ff644" integrity sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g== -<<<<<<< HEAD -loglevel@^1.4.1, loglevel@^1.6.4, loglevel@^1.6.6, loglevel@^1.6.7: -======= -loglevel@^1.4.1, loglevel@^1.6.4, loglevel@^1.6.6, loglevel@^1.6.8: ->>>>>>> next +loglevel@^1.4.1, loglevel@^1.6.4, loglevel@^1.6.6, loglevel@^1.6.7, loglevel@^1.6.8: version "1.6.8" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.8.tgz#8a25fb75d092230ecd4457270d80b54e28011171" integrity sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==