chrisvfritz / prerender-spa-plugin

Prerenders static HTML in a single-page application.
MIT License
7.32k stars 634 forks source link

Unable to prerender all routes error using Jenkins #350

Open avxkim opened 5 years ago

avxkim commented 5 years ago

Here's the error:

-  Building for production...
[prerender-spa-plugin] Unable to prerender all routes!
 ERROR  Failed to compile with 1 errors23:30:41
[prerender-spa-plugin] Unable to prerender all routes!

And detailed log:

0 info it worked if it ends with ok
1 verbose cli [ '/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/bin/node',
1 verbose cli   '/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle dmvno-new-site@0.1.0~prebuild: dmvno-new-site@0.1.0
6 info lifecycle dmvno-new-site@0.1.0~build: dmvno-new-site@0.1.0
7 verbose lifecycle dmvno-new-site@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle dmvno-new-site@0.1.0~build: PATH: /home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/jenkins/.jenkins/workspace/dmvno-site_master/node_modules/.bin:/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/jenkins/.local/bin:/home/jenkins/bin
9 verbose lifecycle dmvno-new-site@0.1.0~build: CWD: /home/jenkins/.jenkins/workspace/dmvno-site_master
10 silly lifecycle dmvno-new-site@0.1.0~build: Args: [ '-c', 'vue-cli-service build' ]
11 silly lifecycle dmvno-new-site@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle dmvno-new-site@0.1.0~build: Failed to exec build script
13 verbose stack Error: dmvno-new-site@0.1.0 build: `vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid dmvno-new-site@0.1.0
15 verbose cwd /home/jenkins/.jenkins/workspace/dmvno-site_master
16 verbose Linux 3.10.0-693.2.1.el7.x86_64
17 verbose argv "/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/bin/node" "/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_8.x/bin/npm" "run" "build"
18 verbose node v8.11.3
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error dmvno-new-site@0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the dmvno-new-site@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I have no idea what's wrong, it was working before. I didn't changed anything in a prerender settings. Any assumptions?

milewski commented 4 years ago

I have the same problem, things doesnt seen to be working on linux anymore, it does works on mac thou... the only thing my CI did everytime before pre-rendering was do npm install so it would occuasionally upgrade some dependencies... i will dig up see witch depencency got update and broke the whole thing...

milewski commented 4 years ago

used Yarn to install all dependencies instead of NPM and everything back to work...

avxkim commented 4 years ago

@milewski in my case issue was with node version, it was 8.x in jenkins, i've changed it to 12.x and it built it successfully.

milewski commented 4 years ago

I had it upgraded from 8 all the way to 13... and didnt work.. I had even upgraded my chromium version in my docker file with no success:

FROM node:13-alpine

ARG REPOSITORY_MIRROR=http://dl-cdn.alpinelinux.org

RUN echo $REPOSITORY_MIRROR/alpine/v3.10/main > /etc/apk/repositories && \
    echo $REPOSITORY_MIRROR/alpine/v3.10/community >> /etc/apk/repositories && \
    apk add --no-cache chromium \
                       harfbuzz \
                       nss \
                       python \
                       alpine-sdk

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROME_PATH=/usr/lib/chromium/

reverting everything back to original and running yarn instead of npm install sundently fixed the issue... i have no clue which package was the issue... but at least it is working again \o/