0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Azure】Github Actions経由でReactアプリをAzure App Serviceにデプロイすると失敗する

Posted at

はじめに

ReactプロジェクトをGithub ActionsでAzure App Serviceに自動デプロイをしようとした際にエラーが出力されてうまくいかなかったため、解決策を共有します。

問題

Github Actionsからデプロイした際に、ビルドで以下のエラーが出力される。

> reactapp6.client@0.0.0 build
> vite build

There was an error exporting the HTTPS developer certificate to a file. Please create the target directory before exporting. Choose permissions carefully when creating it.
failed to load config from D:\a\AutoDeployTest\AutoDeployTest\reactapp6.client\vite.config.js
error during build:
Error: Could not create certificate.
    at file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/.vite-temp/vite.config.js.timestamp-1733635020217-ec2ccb5262f8b.mjs:24:11
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadConfigFromBundledFile (file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:53604:15)
    at async loadConfigFromFile (file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:53433:24)
    at async resolveConfig (file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:52956:24)
    at async createBuilder (file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:51044:18)
    at async CAC.<anonymous> (file:///D:/a/AutoDeployTest/AutoDeployTest/reactapp6.client/node_modules/vite/dist/node/cli.js:851:23)
Error: Process completed with exit code 1.

解決策

以下の記事で発生しているエラーと全く同じため同じように対応する。

おわりに

同じエラーをローカルのビルド時にも見ていたはずなのに思い出すのに3時間ぐらいかかりました。ただ思い出したら記事にした通りの手順で解決できたので、自分の記事に助けられました。

こういうことがあると記事を書いててよかったなーって思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?