vuejs-translations / docs-cs

Czech translation for Vue docs
https://cs.vuejs.org/
Other
2 stars 2 forks source link

Vercel build keeps failing #132

Closed AloisSeckar closed 3 weeks ago

AloisSeckar commented 6 months ago

When ryu-cho creates pull request, the automated Vercel build always fails for some reason (eg. here).

There are links to failed build, but I don't have Vercel account yet to see them. Should I create one to investigate further, or can someone check what's wrong?

AloisSeckar commented 5 months ago

I just realized it is not only preview builds that fail, but also all the production ones. For last couple of weeks, the changed I am regulary making do not appear on the live website. Czech docs are stuck and outdated now 😢 Noone noticed yet tho...

I tried to check Vercel deplyment log, but apparently I have no permission to see it (I created an account via my GitHub)

@Jinjiang can you help or point me out where to find help, please? 🙏

Jinjiang commented 5 months ago

@AloisSeckar let me check

Jinjiang commented 5 months ago

Here attached the error log first:

04:29:59.983 | x Build failed in 13.48s
04:29:59.983 | ✖ building client + server bundles...
04:29:59.990 | build error:
04:29:59.990 | Error: [vitepress] 1 dead link(s) found.
04:29:59.990 | at Object.renderStart (file:///vercel/path0/node_modules/.pnpm/vitepress@1.1.4_@types+node@20.10.1_terser@5.14.2/node_modules/vitepress/dist/node/serve-CXVdC751.js:42420:15)
04:29:59.990 | at file:///vercel/path0/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19563:40
04:29:59.990 | at async Promise.all (index 0)
04:29:59.990 | at async PluginDriver.hookParallel (file:///vercel/path0/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19491:9)
04:29:59.990 | at async Bundle.generate (file:///vercel/path0/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:17921:13)
04:29:59.990 | at async file:///vercel/path0/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:20479:27
04:29:59.990 | at async catchUnfinishedHookActions (file:///vercel/path0/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19907:16)
04:30:00.051 | Error: Command "npm run build" exited with 1

For the permission, I'm stilling checking. 🙏

AloisSeckar commented 5 months ago

@Jinjiang why it runs an npm command, when the project is pnpm based? Can the build command be changed at Vercel? pnpm-lock.yaml should be up-to-date with vuejs/docs

Jinjiang commented 5 months ago

Yes, it's npm run build. However, it just calls a npm script. I believe it's not related to this error.

I found the error was caused by this commit. https://github.com/vuejs-translations/docs-cs/commit/13f25c82457a9c9d72b8db3f2e2e2b60a4508c53

since the latest successful deployment is based on the previous one.

image

Do you think there is anything suspicious?

AloisSeckar commented 5 months ago

No, but since I digged up what VitePress considers being a "dead link", I guess there must be some invalid relative link introduced with this. Probably on "Glossary" page. Or maybe somewhere else I point to .cs/NOTES.md. Thank you for investigating, I will check the code.

AloisSeckar commented 5 months ago

Yay, got it - missed trailing slash 😞 - 062577838134badd70f8f0424b764d97b54db437

AloisSeckar commented 4 months ago

Last commit caused failure again - db5d2e445d75c472e88d134ed335d85c5565b988

There were couple of changes in setup. @Jinjiang can you please check Vercel log again? If I missed something while copying changes from vue/docs?

Jinjiang commented 4 months ago

@AloisSeckar sorry to know that. Here is the latest error log:

[15:09:23.934] Running build in Washington, D.C., USA (East) – iad1
[15:09:24.026] Cloning github.com/vuejs-translations/docs-cs (Branch: main, Commit: b4fe6e3)
[15:09:24.534] Cloning completed: 507.993ms
[15:09:25.098] Restored build cache
[15:09:25.170] Running "vercel build"
[15:09:25.667] Vercel CLI 34.2.0
[15:09:26.344] Warning: Due to "engines": { "node": ">=14.0.0" } in your `package.json` file, the Node.js Version defined in your Project Settings ("18.x") will not apply. Learn More: http://vercel.link/node-version
[15:09:26.344] Warning: Detected "engines": { "node": ">=14.0.0" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[15:09:26.356] Detected `pnpm-lock.yaml` version 9 generated by pnpm 9
[15:09:26.357] Running "install" command: `pnpm install`...
[15:09:27.659]  ERR_PNPM_BAD_PM_VERSION  This project is configured to use v9.1.1 of pnpm. Your current pnpm is v9.0.4
[15:09:27.659] 
[15:09:27.659] If you want to bypass this version check, you can set the "package-manager-strict" configuration to "false" or set the "COREPACK_ENABLE_STRICT" environment variable to "0"
[15:09:27.676] Error: Command "pnpm install" exited with 1
[15:09:27.911] 

Is that helpful? Let me know anything I can help.

AloisSeckar commented 4 months ago

Thanks for investigation.

ERR_PNPM_BAD_PM_VERSION  This project is configured to use v9.1.1 of pnpm. Your current pnpm is v9.0.4

This looks pretty straightforward. But since still I cannot access the Vercel project, I don't know how to change deployment settings.

I am logging to Vercel using this GitHub account. But I am getting: image

AloisSeckar commented 4 months ago

For temporary fix I can try set "packageManager": "pnpm@9.0.4" in project's package.json

But this will divert from vuejs/docs, so I am not sure, if it is good idea...

Jinjiang commented 4 months ago

Interesting. I will take a further look later.

https://vercel.com/docs/deployments/builds/package-managers This is what I've found so far.

About the access, the current team plan doesn't provide a proper option to access a certain repo/app only. I'll let you know once we are able to achieve that. Thanks for understanding 🙏

AloisSeckar commented 4 months ago

No worries. It is just I have to call you for help instead of being able to fix things myself.

I believe allowing Corepack in the build setup should help?

Or maybe quite the contrary - it is now allowed and it is trying to pick pnpm 9.1.1, but Vercel only has 9.0.4 available for some reason?

AloisSeckar commented 4 months ago

Fixed for now with d9eb007285daf6d7f47de0eab726f6003a35380e

Jinjiang commented 4 months ago

@AloisSeckar I've added ENABLE_EXPERIMENTAL_COREPACK to the env vars. Feel free to check and let me know whether it works. Thanks.

AloisSeckar commented 4 months ago

@AloisSeckar I've added ENABLE_EXPERIMENTAL_COREPACK to the env vars. Feel free to check and let me know whether it works. Thanks.

looks like it is working - changed the package manager setting and the build passed : https://github.com/vuejs-translations/docs-cs/commit/cbe8e1254705fb00e4b2d58100c50a853ab7e3a3

AloisSeckar commented 3 months ago

@Jinjiang may I kindy ask once again what is wrong with Vercel deployment now? It started failing today after 1bfdf5b428b72cafd8adcb6c47966dba3a65c894

Jinjiang commented 3 months ago

Seems still pnpm lock file issue: ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json

Full log:

[03:25:10.209] Running build in Washington, D.C., USA (East) – iad1
[03:25:10.321] Cloning github.com/vuejs-translations/docs-cs (Branch: main, Commit: fb57a28)
[03:25:10.847] Cloning completed: 525.6ms
[03:25:11.572] Restored build cache
[03:25:11.651] Running "vercel build"
[03:25:12.101] Vercel CLI 34.2.7
[03:25:12.748] > Detected ENABLE_EXPERIMENTAL_COREPACK=1 and "pnpm@9.1.4" in package.json
[03:25:12.880] Warning: Due to "engines": { "node": ">=14.0.0" } in your `package.json` file, the Node.js Version defined in your Project Settings ("18.x") will not apply. Learn More: http://vercel.link/node-version
[03:25:12.881] Warning: Detected "engines": { "node": ">=14.0.0" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[03:25:12.894] Running "install" command: `pnpm install`...
[03:25:13.593]  ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
[03:25:13.593] 
[03:25:13.593] Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
[03:25:13.593] 
[03:25:13.593]     Failure reason:
[03:25:13.593]     specifiers in the lockfile ({"@vue/repl":"^4.2.1","@vue/theme":"^2.2.12","dynamics.js":"^1.1.5","gsap":"^3.12.5","vitepress":"^1.2.3","vue":"^3.4.27","@types/body-scroll-lock":"^3.1.2","@types/markdown-it":"^14.1.1","@types/node":"^20.14.1","terser":"^5.31.0","typescript":"^5.4.5","vue-tsc":"^2.0.19"}) don't match specs in package.json ({"@types/body-scroll-lock":"^3.1.2","@types/markdown-it":"^14.1.1","@types/node":"^20.14.1","terser":"^5.31.0","typescript":"^5.4.5","vue-tsc":"^2.0.19","@vue/repl":"^4.2.1","@vue/theme":"^2.2.12","dynamics.js":"^1.1.5","gsap":"^3.12.5","vitepress":"^1.2.2","vue":"^3.4.27"})
[03:25:13.611] Error: Command "pnpm install" exited with 1
[03:25:13.898] 

Status x commits

image

AloisSeckar commented 3 months ago

Thank you again. pnpm-lock.yaml was ok, but somehow there was a change in package.json I forgot to port from main repo.

Closing until next such issue araise

AloisSeckar commented 3 weeks ago

It happen again with c617e0bb552adad9745215fa19802dee68d24d13

@Jinjiang may I as once again for checking Vercel logs? 🙏

AloisSeckar commented 3 weeks ago

nvm...found it and fixed it (bd09f596f945bf08aefd5e8be47bc2a0b2492534)