Skip to content
This repository was archived by the owner on Apr 9, 2023. It is now read-only.
This repository was archived by the owner on Apr 9, 2023. It is now read-only.

Unable to prerender all routes! #196

Closed
@484sha

Description

@484sha

Hi, I have a trouble in using prerender-spa-plugin in my vue project with vue2.0 + vue-router.

This is my webpack.prod.conf.js:
new PrerenderSPAPlugin({
staticDir: path.join(__dirname, '../dist'),
routes: ['/home/homePage'],
})

This is my /router/index.js:
export default new Router({
mode: 'history',
linkActiveClass: 'is-active',
routes: [
{ path: '/', redirect: '/home/layout' },
...Home
]
})

This is my router under layout:
export default {
name: 'home.layout',
path: '/home/layout',
component: r => require.ensure([], () => r(require('src/modules/home/layout/page/index.vue')), 'HomeLayout'),
redirect: '/home/homePage',
children: [
homePage
]
};

My homePage is under layout.When I build:
building for production...[prerender-spa-plugin] Unable to prerender all routes!
(node:6184) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Navigation Timeout Exceeded: 30000ms exceeded

Can you help me?Thanks

Activity

JoshTheDerf

JoshTheDerf commented on May 16, 2018

@JoshTheDerf
Collaborator

Looks like you need to configure your renderer. You haven't set any triggers for it to render on.
This one will render after five seconds.

new PrerenderSPAPlugin({
  staticDir: path.join(__dirname, '../dist'),
  routes: ['/home/homePage'],
  renderer: new PrerenderSPAPlugin.PuppeteerRenderer({
    renderAfterTime: 5000
  })
})
484sha

484sha commented on May 22, 2018

@484sha
Author

Thanks a lot.I have been resolved the problem.

katoto

katoto commented on Jul 18, 2018

@katoto

how to ?

484sha

484sha commented on Aug 27, 2018

@484sha
Author

@katoto You can use renderAfterTime

lzh15378738622

lzh15378738622 commented on Oct 20, 2020

@lzh15378738622

maybe my project run build it's suceess, but whatever the config routes is, the build result has only one dir in dist !

lzh15378738622

lzh15378738622 commented on Oct 20, 2020

@lzh15378738622

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @JoshTheDerf@lzh15378738622@katoto@484sha

        Issue actions

          Unable to prerender all routes! · Issue #196 · chrisvfritz/prerender-spa-plugin