Skip to content

Commit

Permalink
fix: ensure preview is object with getStorybook() for storybook@3
Browse files Browse the repository at this point in the history
  • Loading branch information
jholt1 authored and chrisvxd committed Sep 2, 2018
1 parent 9b8bf99 commit 1fe6409
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/getStorybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default async (browser, iframeUrl) => {
waitUntil: "networkidle2"
});

return page.evaluate("(typeof preview !== 'undefined') ? preview.getStorybook() : __STORYBOOK_CLIENT_API__.getStorybook()");
return page.evaluate("(typeof preview === 'object' && typeof preview.getStorybook !== 'undefined') ? preview.getStorybook() : __STORYBOOK_CLIENT_API__.getStorybook()");
};

0 comments on commit 1fe6409

Please sign in to comment.