openRin / Rin

⚡Dynamic blog based on Cloudflare Pages + Workers + D1 + R2
https://rin-docs.xeu.life
MIT License
1.54k stars 665 forks source link

[Help] SEO Workflow 部署失败 #234

Open ethanxyzhu opened 3 months ago

ethanxyzhu commented 3 months ago

日志如下:

Run cd Rin/
bun install v1.1.21 (70ca2b76)
Resolving dependencies
Resolved, downloaded and extracted [122]

+ autoprefixer@10.4.19
+ i18next-parser@9.0.0
+ postcss@8.4.38
+ puppeteer@22.13.0
+ tailwindcss@3.4.4
+ turbo@1.13.4
+ vitest@1.3.0
+ @types/react-syntax-highlighter@15.5.13
+ fast-xml-parser@4.4.0
+ html-to-md@0.8.5
+ react-markdown@9.0.1
+ react-syntax-highlighter@15.5.0
+ rehype-katex@7.0.0
+ rehype-mathjax@6.0.0
+ rehype-parse@9.0.0
+ rehype-raw@7.0.0
+ rehype-react@8.0.0
+ rehype-sanitize@6.0.0
+ remark-gfm@4.0.0
+ remark-math@6.0.0
+ remark-rehype@11.1.0

1023 packages installed [4.57s]

Blocked 10 postinstalls. Run `bun pm untrusted` for details.
259 |             if (this.puppeteer.configuration.browserRevision) {
260 |                 throw new Error(`Tried to find the browser at the configured path (${executablePath}) for revision ${this.puppeteer.browserRevision}, but no executable was found.`);
261 |             }
262 |             switch (this.product) {
263 |                 case 'chrome':
264 |                     throw new Error(`Could not find Chrome (ver. ${this.puppeteer.browserRevision}). This can occur if either\n` +
                                ^
error: Could not find Chrome (ver. 126.0.6478.126). This can occur if either
 1. you did not perform an installation before running the script (e.g. `npx puppeteer browsers install chrome`) or
 2. your cache path is incorrectly configured (which is: /home/runner/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
      at resolveExecutablePath (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:264:27)
      at /home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:83:37

Bun v1.1.21 (Linux x64 baseline)
Error: Process completed with exit code 1.

图片

ossplus commented 3 months ago

puppeteer 改成 puppeteer@22.15.0 然后重新生成bun.lockb

OXeu commented 3 months ago

这个主要是由于 chrome 更新导致下载的版本与 puppeteer 版本内置需求的 Chrome 版本不一致导致的, @ossplus 的方法应该能解决,但是目前 SEO 的作用比较小,至少 Google 是支持 CSR 的,后面有时间会尝试迁移到 Next.js,就不再需要这个 SEO 方法了

iam2r commented 3 weeks ago

Set up Puppeteer中的 npx puppeteer browsers install chrome 放到Run script中

    run: |
      cd Rin/
      bun install --frozen-lockfile
      npx puppeteer browsers install chrome
      bun scripts/render.ts