-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
[Error: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded] #182
Comments
经定位、查找 pptr 官网文档 new PrerenderSPAPlugin({
// Required - The path to the webpack-outputted app to prerender.
staticDir: docsBuildDist,
outputDir: docsConfig.repo ? `${docsBuildDist}/${docsConfig.repo}` : docsBuildDist,
indexPath: docsConfig.repo ? `${docsBuildDist}/${docsConfig.repo}/index.html` : `${docsBuildDist}/index.html`,
// Required - Routes to render.
routes,
successCb: async () => {
if (docsConfig.repo) {
// not use fs.move here or it'll throw error in github action
await fs.copy(`${docsBuildDist}/${docsConfig.repo}`, docsBuildDist)
await fs.remove(`${docsBuildDist}/${docsConfig.repo}`)
// move README as root index.html
await fs.copy(`${docsBuildDist}/README/index.html`, `${docsBuildDist}/index.html`)
console.log('generate prerender file success!')
if (docsConfig.seo) {
if (docsConfig.seo.google) {
fs.writeFileSync(`${docsBuildDist}/sitemap.xml`, generateSiteMap(routes))
}
}
console.log('generate sitemap file success!')
}
},
// The actual renderer to use. (Feel free to write your own)
// Available renderers: https://github.com/Tribex/prerenderer/tree/master/renderers
renderer: new Renderer({
// Optional - The name of the property to add to the window object with the contents of `inject`.
injectProperty: '__PRERENDER_INJECTED',
// Optional - Any values you'd like your app to have access to via `window.injectProperty`.
inject: {
prerender: true,
},
// Optional - defaults to 0, no limit.
// Routes are rendered asynchronously.
// Use this to limit the number of routes rendered in parallel.
maxConcurrentRoutes: 4,
+ // https://pptr.dev/#?product=Puppeteer&version=v5.5.0&show=api-pagegotourl-options
+ navigationOptions: {
+ timeout: 0
+ }
}),
}), 尝试在 pptr 的 goto 方法上传入 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: