サムネイル

ぴえん。。。突然Vercelにデプロイできなくなったよ〜。。。

こんにちは。
今回は題名にもありますが、突然Vercelにデプロイできなくなってしまったので私がどのように解決したのかダラダラやっていきます。

ログを確認しろ!!

当たり前ですが「ログを確認しろ!!」です。
ログにはエラーの原因が必ず書いています。(英語なので読む気が失せますが。。。)

自分の場合も遠回りしましたがログを見ました。
その内容がこれです。

[16:53:54.204] Cloning github.com/watataku8911/watataku-blog (Branch: develop_ver.14, Commit: 7200375) [16:53:54.952] Cloning completed: 748.213ms [16:53:55.338] No Build Cache available [16:53:55.375] Running "vercel build" [16:53:55.851] Vercel CLI 28.2.5 [16:53:56.135] Detected `package-lock.json` generated by npm 7+... [16:53:56.143] Installing dependencies... [16:54:20.016] [16:54:20.016] added 824 packages in 24s [16:54:20.017] [16:54:20.017] 133 packages are looking for funding [16:54:20.017] run `npm fund` for details [16:54:20.044] Detected Next.js version: 12.0.7 [16:54:20.052] Running "npm run build" [16:54:20.346] [16:54:20.347] > build [16:54:20.347] > next build [16:54:20.347] [16:54:22.229] Attention: Next.js now collects completely anonymous telemetry regarding usage. [16:54:22.230] This information is used to shape Next.js' roadmap and prioritize features. [16:54:22.230] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [16:54:22.230] https://nextjs.org/telemetry [16:54:22.230] [16:54:22.245] Browserslist: caniuse-lite is outdated. Please run: [16:54:22.245] npx browserslist@latest --update-db [16:54:22.245] [16:54:22.245] Why you should do it regularly: [16:54:22.245] https://github.com/browserslist/browserslist#browsers-data-updating [16:54:22.286] info - Checking validity of types... [16:54:27.983] info - Creating an optimized production build... [16:54:28.045] > [PWA] Compile client (static) [16:54:28.045] > [PWA] Auto register service worker with: /vercel/path0/node_modules/next-pwa/register.js [16:54:28.046] > [PWA] Service worker: /vercel/path0/.next/sw.js [16:54:28.046] > [PWA] url: /sw.js [16:54:28.047] > [PWA] scope: / [16:54:28.214] Browserslist: caniuse-lite is outdated. Please run: [16:54:28.215] npx browserslist@latest --update-db [16:54:28.215] [16:54:28.215] Why you should do it regularly: [16:54:28.215] https://github.com/browserslist/browserslist#browsers-data-updating [16:54:28.238] > [PWA] Compile server [16:54:38.048] Failed to compile. [16:54:38.048] [16:54:38.048] Please check your GenerateSW plugin configuration: [16:54:38.048] [WebpackGenerateSW] 'pwa' property is not expected to be here. [16:54:38.048] [16:54:38.048] [16:54:38.048] > Build failed because of webpack errors [16:54:38.075] Error: Command "npm run build" exited with 1

見てるだけで吐き気を起こしてしまいます。
でも、よく見るとエラーの原因が書いてありました。

Browserslist: caniuse-lite is outdated. Please run: [16:54:28.215] npx browserslist@latest --update-db
Browserslist: caniuse-lite は古くなっています。npx browserslist@latest --update-dbを実行してください。

とりあえず指示通りに書きコマンドを実行しました。

$ npx browserslist@latest --update-db

実行後、デプロイできました。良かった良かったw

まとめ

ログを見ろ!!以上。さすれば解決できる。

参考文献