question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[prerender-spa-plugin] Unable to prerender all routes!

See original GitHub issue

I think prerender-spa-plugin is very good I tried to use it on my website, but the local build succeeded, but the build on jenkins failed

  • Building for buildUat… Browserslist: caniuse-lite is outdated. Please run next command npm update [prerender-spa-plugin] Unable to prerender all routes! ERROR Failed to compile with 1 errors12:29:37 AM

error

[prerender-spa-plugin] Unable to prerender all routes!

ERROR Build failed with errors. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! proj-hyt-web@0.1.0 build:uat: vue-cli-service build --mode buildUat npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the proj-hyt-web@0.1.0 build:uat script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-02-18T00_29_37_088Z-debug.log Build step ‘Execute shell’ marked build as failure Finished: FAILURE

My configuration information:

` vue.config.js–> const path = require(‘path’) const PrerenderSPAPlugin = require(‘prerender-spa-plugin’); const Renderer = PrerenderSPAPlugin.PuppeteerRenderer

module.exports = { publicPath: ‘/’, // assetsDir: ‘./cn’, configureWebpack: { resolve: { symlinks: false, alias: { // Make sure our version of ag-grid & vue is always loaded. // This is needed for yarn link / npm link to work and prevent duplicate versions of these libs // being loaded ‘ag-grid-community/main’: path.resolve(__dirname, ‘node_modules/ag-grid-community/main.js’), ‘ag-grid-community$’: path.resolve(__dirname, ‘node_modules/ag-grid-community/main.js’), vue$: path.resolve(__dirname, ‘node_modules/vue/dist/vue.common.js’), assets: path.resolve(__dirname, ‘src/assets/’), components: path.resolve(__dirname, ‘src/components/’), utils: path.resolve(__dirname, ‘src/utils/’), jquery: path.resolve(__dirname, ‘node_modules/jquery/dist/jquery.min.js’), } }, performance: { hints: false }, plugins: [ new PrerenderSPAPlugin({ staticDir: path.join(__dirname, ‘dist’), routes: [‘/index/home’], postProcess(renderedRoute) { renderedRoute.html = renderedRoute.html .replace(/<script (.*?)>/g, <script $1 defer>) .replace(id="app", id="app" data-server-rendered="true")

                return renderedRoute
              },
            renderer: new Renderer({
                inject: {},
                headless: true,
                renderAfterElementExists: `[data-view]`
            })
        })
    ]
}

}

router.js —> import Vue from ‘vue’ import Router from ‘vue-router’ import Index from ‘./views/index/index.vue’ import Home from ‘./views/index/home.vue’

Vue.use(Router)

export default new Router({ mode: ‘history’, routes: [ { path: ‘/’, redirect: ‘/index/home’ }, { path: ‘/index’, component: Index, children: [ { path: ‘home’, component: Home, }… `

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
kubajmarekcommented, May 22, 2020

Try changing PuppeteerRenderer maxConcurrentRoutes settings, check readme for example.

1reaction
WormGirlcommented, Oct 19, 2020

Try changing PuppeteerRenderer maxConcurrentRoutes settings, check readme for example.

This not work for me I am because of the chinese wall, I use facebook login api,the js lib can not be access. It works fine when remove the lib.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to prerender all routes! · Issue #242 - GitHub
I'm watching the routes come up in headless Chromium, fully load, with no errors in the JS console. Here's my config: ` const...
Read more >
How to fix [prerender-spa-plugin] Unable to prerender all routes
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >
ERROR [prerender-spa-plugin] - Unable to prerender all routes
ok I fixed the problem by rendering less pages. It seems there is a problem with a poor connection, which in my case...
Read more >
prerender-spa-plugin-next - npm
Flexible, framework-agnostic static site generation for sites and SPAs built with webpack.. Latest version: 4.2.3, last published: 5 months ...
Read more >
How to prerender a Vuejs 3 application with Vue Cli? - Get Help
After that I try prerender-spa-plugin but I have an error wheh I make a npm run build : [prerender-spa-plugin] Unable to prerender all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found