Skip to content

Commit

Permalink
Merge pull request #902 from reg-viz/fix_896
Browse files Browse the repository at this point in the history
fix: Stop wait to navigate preview html
  • Loading branch information
Quramy authored Sep 4, 2024
2 parents c2d6586 + 2d72aff commit 20d3398
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 116 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "5.0.0",
"version": "5.0.1-alpha.0",
"useWorkspaces": true,
"npmClient": "yarn"
}
6 changes: 3 additions & 3 deletions packages/storycap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storycap",
"version": "5.0.0",
"version": "5.0.1-alpha.0",
"description": "A Storybook addon, Save the screenshot image of your stories! via puppeteer.",
"engines": {
"node": ">=18"
Expand Down Expand Up @@ -79,7 +79,7 @@
"@types/yargs": "^17.0.0",
"jest": "29.7.0",
"minimist": "1.2.8",
"puppeteer": "19.11.1",
"puppeteer": "23.2.1",
"ts-jest": "29.1.2",
"typedoc": "0.25.13",
"typescript": "5.4.5"
Expand All @@ -90,7 +90,7 @@
"puppeteer-core": "^9.0.0",
"rimraf": "^5.0.0",
"sanitize-filename": "^1.6.3",
"storycrawler": "^5.0.0",
"storycrawler": "^5.0.1-alpha.0",
"yargs": "^17.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/storycrawler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storycrawler",
"version": "5.0.0",
"version": "5.0.1-alpha.0",
"description": "Utilities to build Storybook crawling tools with Puppeteer",
"engines": {
"node": ">=18"
Expand Down
11 changes: 6 additions & 5 deletions packages/storycrawler/src/browser/stories-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ export class StoriesBrowser extends BaseBrowser {
this.logger.debug('Wait for stories definition.');
await this.page.goto(this.connection.url);
let stories: Story[] | null = null;
await this.page.goto(

// Note:
// Don't wait fo this `goto` promise. Sometimes Chromimue emits timeout error and this navigation and causes whole screenshot process abortion.
// For detail, see https://github.com/reg-viz/storycap/issues/896#issuecomment-2317248668
this.page.goto(
this.connection.url + '/iframe.html?selectedKind=story-crawler-kind&selectedStory=story-crawler-story',
{
timeout: 60_000,
waitUntil: 'domcontentloaded',
},
);

await this.page.waitForFunction(
() =>
(window as ExposedWindow).__STORYBOOK_CLIENT_API__ ||
Expand Down
Loading

0 comments on commit 20d3398

Please sign in to comment.