addyosmani / addyosmani/critical

Error running in vercel (node 22)

未关闭
#608 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
10.3k
派生
390
PR 合并指标
30 天内没有已合并 PR

描述

When running in vercel, with node 22 there seems to be an issue launching puppeteer and the embedded chrome browser:
```
[22:45:24.540] Running build in Washington, D.C., USA (East) – iad1
[22:45:24.640] Cloning github.com/zetxek/adrianmoreno.info (Branch: main, Commit: ec240f6)
[22:45:26.223] Cloning completed: 1.586s
[22:45:26.223] Running "echo VERCEL_GIT_COMMIT_REF=$VERCEL_GIT_COMMIT_REF; if [ "$VERCEL_GIT_COMMIT_REF" == "gh-pages" ]; then echo "Skipping build" && exit 0; else echo "Continuing build!" && exit 1; fi; "
[22:45:26.249] VERCEL_GIT_COMMIT_REF=main
[22:45:26.249] Continuing build!
[22:45:28.699] Restored build cache from previous deployment (FMKo7DBf6zPYpzEWJ4Ras1V6vunh)
[22:45:28.774] Running "vercel build"
[22:45:29.202] Vercel CLI 39.1.1
[22:45:29.906] Installing dependencies...
[22:45:33.344] npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
[22:45:33.766] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[22:45:34.995]
[22:45:34.995] added 74 packages, removed 373 packages, and changed 122 packages in 5s
[22:45:34.995]

(...)

[22:45:36.356] Running critical css generation
[22:45:36.357] Starting critical-css
[22:45:38.070] Error: Failed to launch the browser process!
[22:45:38.070] /vercel/path0/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
[22:45:38.070]
[22:45:38.070]
[22:45:38.071] TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
[22:45:38.071]
[22:45:38.071]
[22:45:38.071] Usage: critical []
[22:45:38.071]
[22:45:38.071] Options:
[22:45:38.071] -b, --base Your base directory
[22:45:38.071] -c, --css Your CSS Files (optional)
[22:45:38.071] -w, --width Viewport width
[22:45:38.071] -h, --height Viewport height
[22:45:38.071] -i, --inline Generate the HTML with inlined critical-path CSS
[22:45:38.072] -e, --extract Extract inlined styles from referenced stylesheets
[22:45:38.072]
[22:45:38.072] --inlineImages Inline images
[22:45:38.072] --dimensions Pass dimensions e.g. 1300x900
[22:45:38.072] --ignore RegExp, @type or selector to ignore
[22:45:38.072] --ignore-[OPTION] Pass options to postcss-discard. See https://goo.gl/HGo5YV
[22:45:38.072] --ignoreInlinedStyles Ignore inlined stylesheets
[22:45:38.072] --include RegExp, @type or selector to include
[22:45:38.072] --include-[OPTION] Pass options to inline-critical. See https://goo.gl/w6SHJM
[22:45:38.072] --assetPaths Directories/Urls where the inliner should start looking for assets
[22:45:38.072] --user RFC2617 basic authorization user
[22:45:38.072] --pass RFC2617 basic authorization password
[22:45:38.072] --penthouse-[OPTION] Pass options to penthouse. See https://goo.gl/PQ5HLL
[22:45:38.072] --ua, --userAgent User agent to use when fetching remote src
[22:45:38.073] --strict Throw an error on css parsing errors or if no css is found
[22:45:38.080] Done running critical-css
[22:45:38.081] Done running vercel-build.sh
[22:45:38.176] Build Completed in /vercel/output [8s]
[22:45:38.289] Deploying outputs...
[22:45:40.450]
[22:45:40.703] Deployment completed
[22:45:49.455] Uploading build cache [135.05 MB]...
[22:45:50.901] Build cache uploaded: 1.445s
```

I'm not sure that it's an issue with the library itself but with vercel environment, as referenced in other places (https://github.com/orgs/vercel/discussions/3545)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。