{"action":"created","issue":{"url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/62","repository_url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli","labels_url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/62/comments","events_url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/62/events","html_url":"https://github.com/seek-oss/html-sketchapp-cli/issues/62","id":365226093,"node_id":"MDU6SXNzdWUzNjUyMjYwOTM=","number":62,"title":"Timeout when generating from a Storybook story","user":{"login":"toolmantim","id":153,"node_id":"MDQ6VXNlcjE1Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/153?v=4","gravatar_id":"","url":"https://api.github.com/users/toolmantim","html_url":"https://github.com/toolmantim","followers_url":"https://api.github.com/users/toolmantim/followers","following_url":"https://api.github.com/users/toolmantim/following{/other_user}","gists_url":"https://api.github.com/users/toolmantim/gists{/gist_id}","starred_url":"https://api.github.com/users/toolmantim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolmantim/subscriptions","organizations_url":"https://api.github.com/users/toolmantim/orgs","repos_url":"https://api.github.com/users/toolmantim/repos","events_url":"https://api.github.com/users/toolmantim/events{/privacy}","received_events_url":"https://api.github.com/users/toolmantim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-30T13:47:44Z","updated_at":"2018-10-01T00:55:08Z","closed_at":null,"author_association":"NONE","body":"When generating from a local Storybook server, you receive a request timeout error:\r\n\r\n```\r\n$ html-sketchapp --url 'http://localhost:6006/iframe.html?selectedKind=Sketch&selectedStory=Export' --out-dir dist\r\n{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded\r\n    at Promise.then (buildkite/frontend/node_modules/puppeteer/lib/NavigatorWatcher.js:94:21) name: 'TimeoutError' }\r\n```\r\n\r\nStorybook keeps a webpack HMR event-stream socket open. Switching from `networkidle0` to `networkidle2` fixes it.\r\n\r\nGiven `networkidle2` is the recommended default event to use these days anyhow, perhaps you'd be open to a PR that replaces `networkidle0` with `networkidle2`?\r\n\r\nAside from this one glitch, this works perfectly w/ Storybook — you just create a story with a big Sketch export sheet, and point the CLI directly at it 👌🏼"},"comment":{"url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/comments/425765507","html_url":"https://github.com/seek-oss/html-sketchapp-cli/issues/62#issuecomment-425765507","issue_url":"https://api.github.com/repos/seek-oss/html-sketchapp-cli/issues/62","id":425765507,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTc2NTUwNw==","user":{"login":"toolmantim","id":153,"node_id":"MDQ6VXNlcjE1Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/153?v=4","gravatar_id":"","url":"https://api.github.com/users/toolmantim","html_url":"https://github.com/toolmantim","followers_url":"https://api.github.com/users/toolmantim/followers","following_url":"https://api.github.com/users/toolmantim/following{/other_user}","gists_url":"https://api.github.com/users/toolmantim/gists{/gist_id}","starred_url":"https://api.github.com/users/toolmantim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolmantim/subscriptions","organizations_url":"https://api.github.com/users/toolmantim/orgs","repos_url":"https://api.github.com/users/toolmantim/repos","events_url":"https://api.github.com/users/toolmantim/events{/privacy}","received_events_url":"https://api.github.com/users/toolmantim/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T00:55:08Z","updated_at":"2018-10-01T00:55:08Z","author_association":"NONE","body":"> Since this is so common in dev environments, I'm definitely open to changing it.\r\n\r\n🙏🏼\r\n\r\n> It seems to me that networkidle2 could cause issues for pages that only have an external JS and CSS file, since it could consider the page loaded even while still downloading the assets—am I understanding this correctly? Maybe this needs to be configurable?\r\n\r\nYeah, I'm not sure. Perhaps \"when page has no more then 2 network requests for half a second\" would cause problems for things like you said. I'm guessing it might? So perhaps we need it to be configurable?\r\n\r\nIf it is configurable, I wonder what should be the default? If the default is `networkidle0`, for people that need `networkidle2` the experience will be hitting the 30s timeout and wondering why it's not working. If the default is `networkidle2`, for people that need `networkidle0` the experience (though I'm not 100% sure) would be they end up with missing assets/rendering errors in the export and wonder why that is.\r\n\r\nPerhaps it's best to keep the default as `networkidle0` and perhaps add a nice message? I only knew where to go digging for because I've used `puppeteer` a bit.\r\n\r\n🤔\r\n\r\n> Do you have a source for this? I can't seem to find any advice on this.\r\n\r\nAh, mostly https://github.com/GoogleChrome/puppeteer/issues/1552#issuecomment-350954419 and the fact it's the default example of the Puppeteer readme these days."}}
{"actor":{"display_login":"toolmantim"}}