Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cloudflare pages internal error blog #140

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"postDate": "2024-10-20T04:42:14.510Z"
}
44 changes: 44 additions & 0 deletions src/content/blogs/2024-10-20-cloudflare-pages-internal-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Cloudflare Pagesでinternal errorが出たときの対処法"
description: "Cloudflare Pagesのデプロイで Failed: an internal error occurred. が出たときに行った対処法です。"
category: tech
author: miyaji
tags:
- javascript
- cloudflare
---

Cloudflare Pagesでデプロイを行うと以下のようなエラーが出ました。

```
Failed: an internal error occurred.
```

## 原因と解決法

_routes.jsonが正しいスキーマで書いていなかったためでした。

以下のように`exclude`を忘れていました。

```json
{
"version": 1,
"includes": ["/*"]
}
```

正しくは以下のように`exclude`を追加する必要があります。

```json
{
"version": 1,
"includes": ["/*"],
"exclude": []
}
```

internal errorが出るということはCloudflareはJSONのスキーマを検証していないようです。

## まとめ

JSONのは正しいスキーマで書こう
12 changes: 12 additions & 0 deletions src/content/tags/cloudflare.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Cloudflare",
"description": "Cloudflareは格安でCDNやセキュリティサービスを提供しているネットワークサービスです。また、エッジコンピューティングを利用したサーバーレス関数も提供しています",
"fullSizeImage": true,
"image": "./cloudflare.png",
"links": [
{
"text": "Cloudflare - 公式サイト",
"url": "https://www.cloudflare.com/ja-jp/"
}
]
}
Binary file added src/content/tags/cloudflare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading