Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Stop wait to navigate preview html #902

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading