Giter Site home page Giter Site logo

otoyo / astro-notion-blog Goto Github PK

View Code? Open in Web Editor NEW
621.0 7.0 407.0 1.17 MB

🚀 Begin building your very own Notion Blog with Astro.

Home Page: https://astro-notion-blog.pages.dev/

License: MIT License

JavaScript 27.00% Astro 45.45% TypeScript 26.03% CSS 1.52%
astro astrojs blog cms notion notion-api cloudflare notion-blog astrojs-blog

astro-notion-blog's Introduction

English | 日本語

astro-notion-blog

GitHub stars GitHub license GitHub sponsors

astro-notion-blog enables you to create a blog using Notion and generates it statically, resulting in lightning-fast page views.

  • 🚀 Blazing fast page views
  • 📝 With the ability to write blog content in Notion
  • 🛠️ Customize your site's appearance to your liking
  • ✅ Take advantage of the official Notion APIs

📸 Screenshots

PC

Smartphone

🌐 Demo

https://astro-notion-blog.pages.dev

🛵 Quick Start

Requirements

Steps

  1. If you enjoy using this repo, don't forget to give it a star! 😉
    • This is very motivating!
  2. Simply duplicate the blog template into your Notion workspace.
  3. Once you've duplicated the page (database), customize it to your liking by changing the icon, title, and description.

  1. For future reference, identify the DATABASE_ID by noting the portion of the duplicated page (database) URL that appears as https://notion.so/your-account/?v=xxxx.

  1. Create an integration and note "Internal Integration Token" as NOTION_API_SECRET
  2. To integrate your application with Notion, share a database with your integration.
  3. To make a copy of this repository in your own account, fork it by clicking on the 'Fork' button in the top-right corner of the repository page.
  4. Go to Cloudflare Pages and sign in
  5. Create new project with "Connect to Git" with your forked repository <your-account>/astro-notion-blog, then click "Begin setup"
  6. In "Build settings" section,
    1. Select "Astro" as "Framework preset"
    2. Open "Environment Variables (advanced)" and set NODE_VERSION, NOTION_API_SECRET and DATABASE_ID

  1. After clicking the 'Save and Deploy' button, your Notion Blog will be published once the deployment process is complete.

Please note that the astro-notion-blog requires manual deployment every time you publish a new post or make updates. You can deploy manually from the Cloudflare Pages dashboard or set up a scheduled deploy using CI tools such as GitHub Actions.

⚒️ How to customize

Additional requirements

  • Node.js v18.14.1 or higher

Steps

  1. To set your secrets as environment variables, run the following commands in your terminal:
export NOTION_API_SECRET=<YOUR_NOTION_API_SECRET>
export DATABASE_ID=<YOUR_DATABASE_ID>
  1. Install dependencies and start local server
npm install
npm run dev
  1. Open http://localhost:4321 in your browser
  2. Press Ctrl+C in the terminal to stop

For more information

See wiki.

🐞 Bug reports & feature requests

To report an issue, please create a new Issue. You can use either English or Japanese to describe the issue. 😉

💕 Sponsorship

If you like astro-notion-blog, sponsor me so that I can keep on developing software. Thank you.

GitHub sponsors


astro-notion-blog is based otoyo/notion-blog

astro-notion-blog's People

Contributors

hkob avatar michiof avatar mosugi avatar norikt avatar oika avatar otoyo avatar suzu-gears avatar trickstar13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

astro-notion-blog's Issues

Notion Iconに対応したい

現在、NotionのページやCalloutブロックにて、絵文字のほかに「アイコン」を選べるようになっています。
notion-icons

いまはこれらのアイコンを選んでも、astro-notion-blog側で未対応のため、ブログ上ではアイコンが表示されません。
アイコンを表示できるように変更したいです。


Notionのドキュメント上ではこのアイコンについての記載を見つけられなかったのですが、レスポンスを見ると、icon.external.url などとして、このアイコンのSVG画像ファイルのURLを取得できるようです。

ページのNotionアイコン
page-icon

CalloutブロックのNotionアイコン
callout-icon
※ externalの中身は { url: 'https://www.notion.so/icons/book_brown.svg' } の形式でした

アイコン画像の有効期限はなさそうに見えますので、単純にこのURLをそのまま画像として表示すればいいのかなと思っています。


余談
「カスタム」からアイコンをアップロードした場合は、期限つきの画像URLが返ってくるようなので、こちらに対応する場合はダウンロードが必要になりそうです…!また別でイシュー等たてるほうが良さそうですね。
custom-icon

Ver.0.4 ToDo

  • Change blog index path to root 記事一覧をルートに変更
  • Change font and adjust padding
  • Display DB cover image to header DBカバー画像をヘッダーに表示
  • Display DB icon to site name DBアイコンをサイト名に表示
  • Align left site name サイト名を左寄せ
  • Change link text style like Notion リンクテキストのスタイルをNotionライクに
  • Change heading1, 2, 3 like Notion 見出し1, 2, 3のスタイルをNotionライクに
  • Update README
  • Support custom DB icon / DBアイコンでカスタムアイコンに対応する
  • Copyボタンのテキストを数秒後に元に戻す
  • Update package.json

小さい画像の下に長いキャプションを書くと、画像が左に寄っていく

不具合の概要

メインカラムの横幅よりも小さい画像の下に画像の横幅よりも長いキャプションを書くと、キャプションが画像の横幅をはみ出してfigure要素の横幅となってしまい、画像がどんどん左に寄ってしまう。

image

期待する挙動

↓のようにキャプションの長さに関わらず画像が**寄せを維持するか、

image

↓のNotionのように画像の横幅を超えるキャプションは自動で折り返されるのが良いと思います。

image

しかし、どちらが良いのかというのは判断が付きませんでした。
この点はお任せしたいです。よろしくお願いします。

Document Requests / 追加してほしいドキュメント

If you have requests to add documents to explain kind of customization, feel free to leave a comment.
もしカスタマイズ方法など絵追加してほしいドキュメントがあれば気軽にコメントしてください。

For example, how to change the favicon, how to change the site title, how to import the updates etc.
例)faviconの変更方法、サイトタイトルの変更方法、変更を取り込む方法など

コールアウトの絵文字(アイコン)を削除するとエラーが発生する

不具合の概要

コールアウトの絵文字(アイコン)を削除する方法を偶然発見し、削除したままビルドしたところエラーが発生した。

再現方法

コールアウト アイコン削除
コールアウト内のアイコンではなく、左の6つの点からアイコンのメニューを開くと削除の項目がありました。
これはデスクトップ版ですが、ブラウザ版でも同様の挙動です。

エラーログ

image

期待する挙動

image

絵文字が空であるときには、デフォルトでページメンションのアイコンと似たものが表示されているようです。
しかし、わざわざNotionで絵文字を空にするので、astro-notion-blog上では絵文字とアイコンのスペースが無い、ただの色付きテキストボックスみたいなものになったら良いなと思います。

image
イメージ

ブログTagのページネーションで404が発生する

不具合の概要

/blog/tag/egpa/page/2
2ページ目以降に遷移しようとすると404が表示される

再現方法

tag egpaをクリック
下のページネーションで2ページ目、3ページ目などをクリック(とにかくページ遷移する)

URLはこちら

エラーログ

期待する挙動

2ページ目以降へ遷移できること

スクリーンショット

スクリーンショット 2023-01-27 13 42 42

  • こちらはローカルでのエラー表示

スクリーンショット 2023-01-27 13 43 06

リポジトリとブランチ名

リポジトリ - main

デスクトップ環境

  • OS: [ MacOS]
  • ブラウザ: [ Brave ]
  • ブラウザのバージョン: [1.47.186]

困った方を助ける解説記事を共有しあう活動に素敵な名前を考えたい

経緯

追加してほしいドキュメントが設置されました。

提案

仕組みとしてはボランティアであることを前提に
私たちコミュニティメンバーがwin-winな関係性を作り出せる活動として
認識してもらえるような表現を考えたい

実際解説記事を書いて得られたこと

  • 記事の構成を考える練習になった
  • 実際に困っている人に向けて書ける機会があって何を書くべきかの吟味ができた
  • 読んでもらえることでブログを継続するモチベーションにもなった
  • 「ありがとう」の声を聞けてまた記事を書きたくなった

例えばこんなフレーズ?

  • 解説記事を書くトレーニング
  • あなたのために書くラブレター
  • 遊び方取り扱いナレッジ

コミュニティメンバーそれぞれが目的をもってブログを開設されているかと思います。
目的が異なるのに「改造」「記事」を通して交流が生まれるのって不思議ですよね。。。
ボランティア精神は無いんだけど、
書きたくなる解説記事。
不思議でたまらなくなり、これをうまく言語化できないものかとIssueを立たせていただきました。

Exif削除によって記事の画像の向きが変わる

不具合の概要

Exif削除によって回転情報が無くなった画像の向きが変わり、Notion上とは異なる表示になってしまうことに気づきました。
image

再現方法

Exifに回転情報がある画像を使った記事をビルドする。

期待する挙動

Exifは
・位置情報(+撮影者情報)のみを削除
・回転情報のみを保持して他を削除
のどちらかが良いと考えられます。
専らスマートフォンで撮影した写真を使っているため位置情報にしか気づきませんでしたが、Exifの中には撮影者情報なども含まれることを知ったので、後者のホワイトリスト方式がシンプルで楽そうです。

List type がNotionで指定したのと違う

不具合の概要

Notionでアラビア数字のリストを作成したがデプロイ後のリストはアルファベット(小文字)となっていた。
行頭で作成していてネストしているわけではない。

再現方法

  1. Notionにて番号付きリストを作成する。
  2. デプロイを行いブログを見る。
  3. ネストされていないのにアルファベット(小文字)が表示。

デプロイまでできており公開された URL で不具合が確認できる場合には URL も記載します。

blog.nuovotaka.com

期待する挙動

ネストしない場合は、番号付きリストを表示してほしいです。

スクリーンショット

  • Notion 側の記述

スクリーンショット 2023-04-20 17 15 04

  • デプロイ後のブログの表示

スクリーンショット 2023-04-20 17 15 26

リポジトリとブランチ名

astro-notion-blog-2023 / main

デスクトップ環境

  • OS: [MacOS Big Sur 11.7.6]
  • ブラウザ: [Brave]
  • ブラウザのバージョン: [1.50.121]

アップロードした画像に表示されないものがある

不具合の概要

Notionにアップロードした画像のうち一部の画像ががblog上では表示されない。

再現方法

  1. クイックスタート の手順を 7 まで実施する
  2. カスタマイズするには の手順を実施する
  3. ローカルにCloneしたリポジトリで npm run dev を実行する(npm run build した場合も同様)

下記のページでも同様に発生しているようです。

https://astro-notion-blog-otoyo.vercel.app/posts/a-trip-to-miyakojima-island

エラーログ

エラーログは出力されていませんが、画像が0バイトで壊れてダウンロードされているように見えます。

~/g/g/o/astro-notion-blog ❯❯❯ cd dist/notion/ed4d6f2f-c710-4861-b540-5c4ed44e8729
~/g/g/o/a/d/n/ed4d6f2f-c710-4861-b540-5c4ed44e8729 ❯❯❯ ll
total 0
-rw-r--r--  1 xxx  staff     0B Dec  1 10:36 EC946DBE-9A4C-47BA-827D-C0181EB54B0E.jpeg

期待する挙動

画像が表示される。

スクリーンショット

image

リポジトリとブランチ名

デスクトップ環境

  • OS: MacOS
  • ブラウザ: Chrome
  • ブラウザのバージョン: 119.0.6045.159(Official Build) (arm64)

スマートフォン環境:

  • デバイス: [例 iPhone6]
  • OS: [例 iOS8.1]
  • ブラウザ: [例 Chrome, Safari]
  • ブラウザのバージョン [例 22]

追加情報

自分が新しくアップロードした画像は表示されたので、コピーした画像・古い画像の場合に発生しているように思われます。

Astro * Notionの組み合わせがイケていて素晴らしく、ぜひ自分のサイトでも利用したいと思っておりますので、お手数ですがご確認をお願いします。

Speed up fetching expired image blocks

When file blocks are retrieved from Nx cache, their URL (S3 signed URL) might be already expired.
So URLs must be refreshed with reloading the blocks since #49.
However, the fetching logic is time-consuming so it needs to be faster.

Idea

  1. Enqueue image blocks to queue while building
  2. Download image files to public/notion/images/ after building

`cache:fetch` fails during the Cloudflare Pages building

Since

Feb. 6, 2023

Frequency

Always

Logs

2023-02-08T03:41:49.650865Z	Cloning repository...
2023-02-08T03:41:50.543692Z	From https://github.com/otoyo/notion-blog
2023-02-08T03:41:50.544368Z	 * branch            3c3fe3ffd5b5eb6daa5a7cc297fe384e32353158 -> FETCH_HEAD
2023-02-08T03:41:50.544554Z	
2023-02-08T03:41:50.602763Z	HEAD is now at 3c3fe3f Merge pull request #153 from otoyo/reflect-tag-color
2023-02-08T03:41:50.603343Z	
2023-02-08T03:41:50.748039Z	
2023-02-08T03:41:50.776551Z	Success: Finished cloning repository files
2023-02-08T03:41:51.48726Z	Installing dependencies
2023-02-08T03:41:51.498983Z	Python version set to 2.7
2023-02-08T03:41:55.009263Z	Downloading and installing node v16.13.0...
2023-02-08T03:41:55.46178Z	Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
2023-02-08T03:41:55.899264Z	Computing checksum with sha256sum
2023-02-08T03:41:56.027876Z	Checksums matched!
2023-02-08T03:42:00.303628Z	Now using node v16.13.0 (npm v8.1.0)
2023-02-08T03:42:00.728202Z	Started restoring cached build plugins
2023-02-08T03:42:00.74219Z	Finished restoring cached build plugins
2023-02-08T03:42:01.267266Z	Attempting ruby version 2.7.1, read from environment
2023-02-08T03:42:04.886975Z	Using ruby version 2.7.1
2023-02-08T03:42:05.244058Z	Using PHP version 5.6
2023-02-08T03:42:05.403353Z	5.2 is already installed.
2023-02-08T03:42:05.432282Z	Using Swift version 5.2
2023-02-08T03:42:05.433546Z	Started restoring cached node modules
2023-02-08T03:42:05.449878Z	Finished restoring cached node modules
2023-02-08T03:42:05.458616Z	Started restoring cached yarn cache
2023-02-08T03:42:05.472886Z	Finished restoring cached yarn cache
2023-02-08T03:42:05.494291Z	Installing yarn at version 1.22.4
2023-02-08T03:42:05.512464Z	�[37mInstalling Yarn!�[0m
2023-02-08T03:42:05.512728Z	�[36m> Downloading tarball...�[0m
2023-02-08T03:42:05.557801Z	
2023-02-08T03:42:05.558329Z	[1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.UoGPhdRviv
2023-02-08T03:42:05.559219Z	  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2023-02-08T03:42:05.559537Z	                                 Dload  Upload   Total   Spent    Left  Speed
2023-02-08T03:42:05.807786Z	
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    80  100    80    0     0    321      0 --:--:-- --:--:-- --:--:--   321
100    80  100    80    0     0    321      0 --:--:-- --:--:-- --:--:--   321
2023-02-08T03:42:05.94063Z	
100    92  100    92    0     0    240      0 --:--:-- --:--:-- --:--:--   240
2023-02-08T03:42:06.103601Z	
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2023-02-08T03:42:06.463201Z	
100 1215k  100 1215k    0     0  1344k      0 --:--:-- --:--:-- --:--:-- 1344k
2023-02-08T03:42:06.463537Z	
2023-02-08T03:42:06.463729Z	[2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.UoGPhdRviv.asc
2023-02-08T03:42:06.513276Z	
100    84  100    84    0     0   1711      0 --:--:-- --:--:-- --:--:--  1711
2023-02-08T03:42:06.515674Z	
100    97  100    97    0     0   1882      0 --:--:-- --:--:-- --:--:--  1882
2023-02-08T03:42:06.664795Z	
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2023-02-08T03:42:06.742937Z	
100  1028  100  1028    0     0   3687      0 --:--:-- --:--:-- --:--:--  3687
2023-02-08T03:42:06.791882Z	�[36m> Verifying integrity...�[0m
2023-02-08T03:42:06.834431Z	gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
2023-02-08T03:42:06.840533Z	gpg: Good signature from "Yarn Packaging <[email protected]>"
2023-02-08T03:42:06.843138Z	gpg: Note: This key has expired!
2023-02-08T03:42:06.8435Z	Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
2023-02-08T03:42:06.843723Z	     Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
2023-02-08T03:42:06.844031Z	�[32m> GPG signature looks good�[0m
2023-02-08T03:42:06.844319Z	�[36m> Extracting to ~/.yarn...�[0m
2023-02-08T03:42:06.93694Z	�[36m> Adding to $PATH...�[0m
2023-02-08T03:42:06.963106Z	�[36m> We've added the following to your /opt/buildhome/.bashrc
2023-02-08T03:42:06.963429Z	> If this isn't the profile of your current shell then please add the following to your correct profile:
2023-02-08T03:42:06.963573Z	   
2023-02-08T03:42:06.963692Z	export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2023-02-08T03:42:06.963808Z	�[0m
2023-02-08T03:42:07.354794Z	�[32m> Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.�[0m
2023-02-08T03:42:07.748863Z	Installing NPM modules using Yarn version 1.22.4
2023-02-08T03:42:08.474755Z	yarn install v1.22.4
2023-02-08T03:42:08.565454Z	[1/4] Resolving packages...
2023-02-08T03:42:08.837371Z	[2/4] Fetching packages...
2023-02-08T03:42:25.419026Z	warning [email protected]: The engine "pnpm" appears to be invalid.
2023-02-08T03:42:25.421245Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.421579Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.422584Z	info @esbuild/[email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.422947Z	info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.423317Z	info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.423594Z	info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.423931Z	info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.424217Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.424482Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.42472Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.424938Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.42518Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.425428Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.42573Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.425875Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.426005Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.426134Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.426423Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.426648Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.426855Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.426986Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.427296Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.427477Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.427602Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.427741Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.427852Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.427966Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.428088Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.428209Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.428317Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.428427Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.428534Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.428654Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.428898Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.429027Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.429153Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.429266Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.429385Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.429503Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.429613Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.429721Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.429827Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.431305Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.431483Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.431639Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.431786Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.431932Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.432146Z	info [email protected]: The platform "linux" is incompatible with this module.
2023-02-08T03:42:25.432302Z	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-02-08T03:42:25.43249Z	info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-02-08T03:42:25.435179Z	[3/4] Linking dependencies...
2023-02-08T03:42:25.436786Z	warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react@^17.0.50 || ^18.0.21".
2023-02-08T03:42:25.437063Z	warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react-dom@^17.0.17 || ^18.0.6".
2023-02-08T03:42:25.439475Z	warning "@typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
2023-02-08T03:42:36.853237Z	[4/4] Building fresh packages...
2023-02-08T03:42:38.668626Z	Done in 30.20s.
2023-02-08T03:42:38.70341Z	NPM modules installed using Yarn
2023-02-08T03:42:39.000751Z	Installing Hugo 0.54.0
2023-02-08T03:42:39.840409Z	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2023-02-08T03:42:39.844435Z	Started restoring cached go cache
2023-02-08T03:42:39.864095Z	Finished restoring cached go cache
2023-02-08T03:42:40.015208Z	go version go1.14.4 linux/amd64
2023-02-08T03:42:40.030794Z	go version go1.14.4 linux/amd64
2023-02-08T03:42:40.033625Z	Installing missing commands
2023-02-08T03:42:40.033876Z	Verify run directory
2023-02-08T03:42:40.034132Z	Executing user command: npm run build:cached
2023-02-08T03:42:40.498019Z	
2023-02-08T03:42:40.49844Z	> [email protected] build:cached
2023-02-08T03:42:40.498601Z	> npm run cache:fetch && astro build
2023-02-08T03:42:40.498806Z	
2023-02-08T03:42:40.88278Z	
2023-02-08T03:42:40.883145Z	> [email protected] cache:fetch
2023-02-08T03:42:40.883338Z	> node scripts/blog-contents-cache.cjs
2023-02-08T03:42:40.883481Z	
2023-02-08T03:43:59.209632Z	exec error: Error: Command failed: NX_BRANCH=main npx nx run astro-notion-blog:_fetch-notion-blocks <block_id> 2023-02-04T07:43:00.000Z
2023-02-08T03:43:59.210034Z	
2023-02-08T03:43:59.213269Z	/opt/buildhome/repo/scripts/blog-contents-cache.cjs:74
2023-02-08T03:43:59.21349Z	            throw err;
2023-02-08T03:43:59.213626Z	            ^
2023-02-08T03:43:59.213754Z	
2023-02-08T03:43:59.213877Z	Error: Command failed: NX_BRANCH=main npx nx run astro-notion-blog:_fetch-notion-blocks <block_id> 2023-02-04T07:43:00.000Z
2023-02-08T03:43:59.214013Z	
2023-02-08T03:43:59.214155Z	    at ChildProcess.exithandler (node:child_process:397:12)
2023-02-08T03:43:59.214277Z	    at ChildProcess.emit (node:events:390:28)
2023-02-08T03:43:59.214402Z	    at maybeClose (node:internal/child_process:1064:16)
2023-02-08T03:43:59.214522Z	    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
2023-02-08T03:43:59.214649Z	  killed: true,
2023-02-08T03:43:59.214765Z	  code: null,
2023-02-08T03:43:59.21488Z	  signal: 'SIGTERM',
2023-02-08T03:43:59.215001Z	  cmd: 'NX_BRANCH=main npx nx run astro-notion-blog:_fetch-notion-blocks <block_id> 2023-02-04T07:43:00.000Z'
2023-02-08T03:43:59.215131Z	}
2023-02-08T03:43:59.236988Z	Failed: build command exited with code: 1
2023-02-08T03:44:00.164803Z	Failed: an internal error occurred

Try

  • Rollback to 2 days ago
    • Not improved
  • Set cache in the local
    • Not improved
  • Stop using a progress bar
    • Improved once but failed again
  • Replace ChildProcess.exec with a shell script entirely

comment機能

不具合の概要

不具合というより、
Nextjs notion blogでは使っていたcomment機能をつけるのに苦労してます。(notion comment)

コメントを見せるのはできるのですが、
コメントを
formで入力するところで、
どうしたらいいか、分からなくなりました。

main...example/like-button-on-vercel
これのようにastroでコメントを使う例を教えていただけないでしょうか。

記事のタイトルが途中で途切れる

不具合の概要

記事のタイトルが途中で途切れる

再現方法

同様のタイトルで今までも記事は書いているが、発生するときとしないときがあります。
発生した場合、10回以上タイトルを消したり、書いたり空白入れたり、削除したりすると途切れず正常にタイトルが表示されるようになる。

発生しているブログ

期待する挙動

記事が途切れず正しく表示されること

スクリーンショット

公開された記事
Screen Shot 2023-05-31 at 15 27 05

notionの記事
Screen Shot 2023-05-31 at 15 27 33

デスクトップ環境

  • OS: macOS
  • ブラウザ: Chrome
  • ブラウザのバージョン: Version 113.0.5672.126

追加情報

なし

public/notion のコピーでエラー

不具合の概要

インライン画像が存在しないときに yarn build 時に cp でエラーになる。

再現方法

インライン画像がないページを準備して、yarn build する

エラーログ

yarn build の結果はこちら

(中略)
cp: public/notion/*: No such file or directory
 error   Command failed: cp -r public/notion/* /Users/hkob/Dropbox/astro/astro-notion-blog/dist/notion
  cp: public/notion/*: No such file or directory

  File:
    /src/integrations/public-notion-copier.ts:15:29

期待する挙動

外部リンク画像しか使っていない場合には、public/notion にはファイルが一つも生成されないので、その時にエラーにならないようにしたい。

リポジトリとブランチ名

main

デスクトップ環境

  • OS: macOS
  • ブラウザ: Arc

追加情報

cp -r public/notion hogehoge/dist という感じで上のフォルダにコピーすればいいと思います。そうすれば上の mkdir の作業も必要なくなると思います。

Web Bookmark が文字化けする

不具合の概要

notion で作成した Web Bookmark に日本語が含まれていると Cloudflare で build した際に文字化けする

再現方法

notion で Web Bookmark を作成する(この時点では文字化けしていない)

image

localhost で確認する(画像は表示されなくなってしまうが文字化けはしていない)

image

Cloudflare でデプロイ後(文字化けしてしまっている)

image

不具合が発生しているサイト:https://kromiii.info/posts/afraid-from-freedom/

エラーログ

ブラウザの開発者コンソールでのログはなし

Cloudflare のログ

2023-08-18T15:17:15.204733Z	Cloning repository...
2023-08-18T15:17:16.056168Z	From https://github.com/kromiii/astro-notion-blog
2023-08-18T15:17:16.056906Z	 * branch            b0e916c82680ede3ed1eb12239cfcd49d20ef20c -> FETCH_HEAD
2023-08-18T15:17:16.0571Z	
2023-08-18T15:17:16.131777Z	HEAD is now at b0e916c change deploy schedule
2023-08-18T15:17:16.13244Z	
2023-08-18T15:17:16.247008Z	
2023-08-18T15:17:16.280562Z	Success: Finished cloning repository files
2023-08-18T15:17:16.93758Z	Detected the following tools from environment: [email protected], [email protected]
2023-08-18T15:17:16.938343Z	Installing nodejs 18.16.0
2023-08-18T15:17:18.074075Z	Trying to update node-build... ok
2023-08-18T15:17:18.363367Z	Downloading node-v18.16.0-linux-x64.tar.gz...
2023-08-18T15:17:18.363928Z	-> https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.gz
2023-08-18T15:17:20.138495Z	Installing node-v18.16.0-linux-x64...
2023-08-18T15:17:21.699011Z	Installed node-v18.16.0-linux-x64 to /opt/buildhome/.asdf/installs/nodejs/18.16.0
2023-08-18T15:17:21.699592Z	
2023-08-18T15:17:23.176099Z	Installing project dependencies: npm clean-install --progress=false
2023-08-18T15:17:31.381227Z	npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
2023-08-18T15:17:40.394553Z	
2023-08-18T15:17:40.39517Z	added 854 packages, and audited 855 packages in 16s
2023-08-18T15:17:40.395375Z	
2023-08-18T15:17:40.395525Z	235 packages are looking for funding
2023-08-18T15:17:40.395658Z	  run `npm fund` for details
2023-08-18T15:17:40.431101Z	
2023-08-18T15:17:40.431527Z	7 vulnerabilities (6 moderate, 1 high)
2023-08-18T15:17:40.431793Z	
2023-08-18T15:17:40.432027Z	To address issues that do not require attention, run:
2023-08-18T15:17:40.432264Z	  npm audit fix
2023-08-18T15:17:40.432531Z	
2023-08-18T15:17:40.432707Z	To address all issues (including breaking changes), run:
2023-08-18T15:17:40.432894Z	  npm audit fix --force
2023-08-18T15:17:40.433065Z	
2023-08-18T15:17:40.43328Z	Run `npm audit` for details.
2023-08-18T15:17:40.457975Z	Executing user command: npm run build
2023-08-18T15:17:41.498302Z	
2023-08-18T15:17:41.498661Z	> [email protected] build
2023-08-18T15:17:41.498858Z	> astro build
2023-08-18T15:17:41.499007Z	
2023-08-18T15:17:43.677382Z	03:17:43 PM [content] No content directory found. Skipping type generation.
2023-08-18T15:17:43.941079Z	03:17:43 PM [build] output target: static
2023-08-18T15:17:43.941602Z	03:17:43 PM [build] Collecting build info...
2023-08-18T15:17:43.942466Z	03:17:43 PM [build] Completed in 327ms.
2023-08-18T15:17:43.943836Z	03:17:43 PM [build] Building static entrypoints...
2023-08-18T15:17:47.909732Z	03:17:47 PM [build] Completed in 3.97s.
2023-08-18T15:17:47.9105Z	
2023-08-18T15:17:47.910732Z	 building client 
2023-08-18T15:18:03.526659Z	�[33m
2023-08-18T15:18:03.527425Z	(!) Some chunks are larger than 500 kBs after minification. Consider:
2023-08-18T15:18:03.527644Z	- Using dynamic import() to code-split the application
2023-08-18T15:18:03.527812Z	- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
2023-08-18T15:18:03.527979Z	- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.�[39m
2023-08-18T15:18:03.528188Z	Completed in 15.62s.
2023-08-18T15:18:03.528329Z	
2023-08-18T15:18:03.52868Z	
2023-08-18T15:18:03.529006Z	 generating static routes 
2023-08-18T15:18:03.550622Z	▶ src/pages/index.astro
2023-08-18T15:18:04.468442Z	  └─ /index.html (+0.93s)
2023-08-18T15:18:04.471102Z	▶ src/pages/posts/page/[page].astro
2023-08-18T15:18:04.474353Z	▶ src/pages/posts/tag/[tag]/page/[page].astro
2023-08-18T15:18:04.48073Z	▶ src/pages/posts/tag/[tag].astro
2023-08-18T15:18:04.499255Z	  ├─ /posts/tag/Book/index.html (+19ms)
2023-08-18T15:18:04.519178Z	  ├─ /posts/tag/Diary/index.html (+42ms)
2023-08-18T15:18:04.527407Z	  ├─ /posts/tag/Health/index.html (+51ms)
2023-08-18T15:18:04.5402Z	  ├─ /posts/tag/Introduction/index.html (+63ms)
2023-08-18T15:18:04.549543Z	  └─ /posts/tag/ガジェット/index.html (+73ms)
2023-08-18T15:18:05.4065Z	▶ src/pages/posts/[slug].astro
2023-08-18T15:18:06.057932Z	  ├─ /posts/afraid-from-freedom/index.html (+1.51s)
2023-08-18T15:18:06.730266Z	  ├─ /posts/necessity-of-monitor/index.html (+2.18s)
2023-08-18T15:18:07.228487Z	  ├─ /posts/tips-of-continue/index.html (+2.68s)
2023-08-18T15:18:08.714967Z	  ├─ /posts/dangers-of-sitting/index.html (+4.16s)
2023-08-18T15:18:10.310294Z	  ├─ /posts/jodein-takaraduka/index.html (+5.76s)
2023-08-18T15:18:10.949217Z	  ├─ /posts/publications/index.html (+6.40s)
2023-08-18T15:18:12.733049Z	  └─ /posts/self-introduction/index.html (+8.18s)
2023-08-18T15:18:12.758051Z	λ src/pages/feed.ts
2023-08-18T15:18:12.764233Z	  └─ /feed (+28ms)
2023-08-18T15:18:12.76522Z	Completed in 9.24s.
2023-08-18T15:18:12.765668Z	
2023-08-18T15:18:12.889161Z	cp: cannot stat 'public/notion/*': No such file or directory
2023-08-18T15:18:12.892674Z	03:18:12 PM [build] 13 page(s) built in 29.28s
2023-08-18T15:18:12.892965Z	03:18:12 PM [build] Complete!
2023-08-18T15:18:12.938946Z	Finished
2023-08-18T15:18:12.93979Z	Note: No functions dir at /functions found. Skipping.
2023-08-18T15:18:12.940017Z	Validating asset output directory
2023-08-18T15:18:13.630531Z	Deploying your site to Cloudflare's global network...
2023-08-18T15:18:16.884998Z	Uploading... (47/57)
2023-08-18T15:18:17.581794Z	Uploading... (50/57)
2023-08-18T15:18:20.390693Z	Uploading... (53/57)
2023-08-18T15:18:34.562571Z	Uploading... (57/57)
2023-08-18T15:18:34.56296Z	✨ Success! Uploaded 10 files (47 already uploaded) (18.82 sec)
2023-08-18T15:18:34.563195Z	
2023-08-18T15:18:34.84968Z	✨ Upload complete!
2023-08-18T15:18:36.983615Z	Success: Assets published!
2023-08-18T15:18:37.71686Z	Success: Your site was deployed!

期待する挙動

Web Bookmark に日本語が含まれていても文字化けしない
(できれば)Notion に含まれる画像も正しく表示される

リポジトリとブランチ名

https://github.com/kromiii/astro-notion-blog

デスクトップ環境

  • OS: MacOS
  • ブラウザ: Chrome
  • ブラウザのバージョン: 115.0.5790.170(Official Build) (arm64)

追加情報

特になし

サブディレクトリが存在する環境で fslightbox.js のパスが合わない

不具合の概要

サブディレクトリ環境で fslightbox.js が読み込めない

再現方法

BASE_DIR を設定して環境で yarn build する

エラーログ

fslightbox.js が読み込めないというエラーになります。

期待する挙動

subdir/scripts/fslightbox.js という正しいパスになって欲しいです。

リポジトリとブランチ名

main

追加情報

現在、fslightbox.js が絶対パスになってしまっています。

    {ENABLE_LIGHTBOX && <script src="/scripts/fslightbox.js" />}

ここも getNavLink で BASE_DIR に基づくパスが出せればいいと思います。

    {ENABLE_LIGHTBOX && <script src={getNavLink('/scripts/fslightbox.js')} />}

while publishing in cloudflare got this error!!

2023-01-22T11:48:06.414738Z Cloning repository...
2023-01-22T11:48:07.288817Z From https://github.com/thamizhnation/astro-notion-blog-1
2023-01-22T11:48:07.289392Z * branch 7e74e1e -> FETCH_HEAD
2023-01-22T11:48:07.289561Z
2023-01-22T11:48:07.345173Z HEAD is now at 7e74e1e Merge pull request #5 from otoyo/fix-blob-fetch
2023-01-22T11:48:07.345825Z
2023-01-22T11:48:07.496961Z
2023-01-22T11:48:07.524854Z Success: Finished cloning repository files
2023-01-22T11:48:08.243905Z Installing dependencies
2023-01-22T11:48:08.255931Z Python version set to 2.7
2023-01-22T11:48:11.695543Z Downloading and installing node v16.13.0...
2023-01-22T11:48:12.122746Z Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
2023-01-22T11:48:12.583402Z Computing checksum with sha256sum
2023-01-22T11:48:12.711172Z Checksums matched!
2023-01-22T11:48:16.990151Z Now using node v16.13.0 (npm v8.1.0)
2023-01-22T11:48:17.390694Z Started restoring cached build plugins
2023-01-22T11:48:17.404719Z Finished restoring cached build plugins
2023-01-22T11:48:17.933204Z Attempting ruby version 2.7.1, read from environment
2023-01-22T11:48:21.58594Z Using ruby version 2.7.1
2023-01-22T11:48:21.951242Z Using PHP version 5.6
2023-01-22T11:48:22.116433Z 5.2 is already installed.
2023-01-22T11:48:22.143775Z Using Swift version 5.2
2023-01-22T11:48:22.144349Z Started restoring cached node modules
2023-01-22T11:48:22.161875Z Finished restoring cached node modules
2023-01-22T11:48:22.170448Z Started restoring cached yarn cache
2023-01-22T11:48:22.186159Z Finished restoring cached yarn cache
2023-01-22T11:48:22.206789Z Installing yarn at version 1.22.4
2023-01-22T11:48:22.224739Z �[37mInstalling Yarn!�[0m
2023-01-22T11:48:22.225087Z �[36m> Downloading tarball...�[0m
2023-01-22T11:48:22.269373Z
2023-01-22T11:48:22.269775Z [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.RT7VRwPBzN
2023-01-22T11:48:22.270433Z % Total % Received % Xferd Average Speed Time Time Time Current
2023-01-22T11:48:22.270991Z Dload Upload Total Spent Left Speed
2023-01-22T11:48:22.558466Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 79 100 79 0 0 274 0 --:--:-- --:--:-- --:--:-- 274
2023-01-22T11:48:22.689883Z
100 93 100 93 0 0 221 0 --:--:-- --:--:-- --:--:-- 221
2023-01-22T11:48:22.852751Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2023-01-22T11:48:23.197497Z
100 1215k 100 1215k 0 0 1310k 0 --:--:-- --:--:-- --:--:-- 1310k
2023-01-22T11:48:23.197848Z
2023-01-22T11:48:23.198075Z [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.RT7VRwPBzN.asc
2023-01-22T11:48:23.254162Z
100 83 100 83 0 0 1490 0 --:--:-- --:--:-- --:--:-- 1490
2023-01-22T11:48:23.256163Z
100 97 100 97 0 0 1680 0 --:--:-- --:--:-- --:--:-- 1680
2023-01-22T11:48:23.386885Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2023-01-22T11:48:23.464943Z
100 1028 100 1028 0 0 3858 0 --:--:-- --:--:-- --:--:-- 3858
2023-01-22T11:48:23.51301Z �[36m> Verifying integrity...�[0m
2023-01-22T11:48:23.557165Z gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
2023-01-22T11:48:23.563289Z gpg: Good signature from "Yarn Packaging [email protected]"
2023-01-22T11:48:23.565776Z gpg: Note: This key has expired!
2023-01-22T11:48:23.566076Z Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
2023-01-22T11:48:23.566229Z Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
2023-01-22T11:48:23.567388Z �[32m> GPG signature looks good�[0m
2023-01-22T11:48:23.568739Z �[36m> Extracting to ~/.yarn...�[0m
2023-01-22T11:48:23.664855Z �[36m> Adding to $PATH...�[0m
2023-01-22T11:48:23.692769Z �[36m> We've added the following to your /opt/buildhome/.bashrc
2023-01-22T11:48:23.693249Z > If this isn't the profile of your current shell then please add the following to your correct profile:
2023-01-22T11:48:23.69439Z
2023-01-22T11:48:23.694706Z export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2023-01-22T11:48:23.69486Z �[0m
2023-01-22T11:48:24.084685Z �[32m> Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.�[0m
2023-01-22T11:48:24.489Z Installing NPM modules using Yarn version 1.22.4
2023-01-22T11:48:25.208127Z yarn install v1.22.4
2023-01-22T11:48:25.296148Z [1/4] Resolving packages...
2023-01-22T11:48:25.553835Z [2/4] Fetching packages...
2023-01-22T11:48:41.255319Z warning [email protected]: The engine "pnpm" appears to be invalid.
2023-01-22T11:48:41.257377Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.257637Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.258626Z info @esbuild/[email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.258833Z info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.258967Z info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.259084Z info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.259202Z info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.259311Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.25942Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.259529Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.259669Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.259783Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.259902Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.260012Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.260119Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.260226Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.260333Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.260442Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.260548Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.260678Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.260789Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.260906Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.261013Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.26112Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.261226Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.261332Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.261438Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.261544Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.26168Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.261789Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.261896Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.262003Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.262108Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.262217Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.262324Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.262432Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.262537Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.262674Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.262793Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.262904Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.26302Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.26322Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.26342Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.263661Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.263859Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.264605Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.264795Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.264991Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T11:48:41.265142Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T11:48:41.265329Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T11:48:41.269201Z [3/4] Linking dependencies...
2023-01-22T11:48:41.27109Z warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react@^17.0.50 || ^18.0.21".
2023-01-22T11:48:41.271328Z warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react-dom@^17.0.17 || ^18.0.6".
2023-01-22T11:48:41.274328Z warning "@typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
2023-01-22T11:48:52.073417Z [4/4] Building fresh packages...
2023-01-22T11:48:53.493752Z Done in 28.29s.
2023-01-22T11:48:53.525932Z NPM modules installed using Yarn
2023-01-22T11:48:53.829871Z Installing Hugo 0.54.0
2023-01-22T11:48:54.53755Z Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2023-01-22T11:48:54.54163Z Started restoring cached go cache
2023-01-22T11:48:54.562086Z Finished restoring cached go cache
2023-01-22T11:48:54.721485Z go version go1.14.4 linux/amd64
2023-01-22T11:48:54.737803Z go version go1.14.4 linux/amd64
2023-01-22T11:48:54.740843Z Installing missing commands
2023-01-22T11:48:54.741156Z Verify run directory
2023-01-22T11:48:54.74139Z Executing user command: npm run build
2023-01-22T11:48:55.207853Z
2023-01-22T11:48:55.208167Z > [email protected] build
2023-01-22T11:48:55.208314Z > astro build
2023-01-22T11:48:55.208431Z
2023-01-22T11:48:57.263649Z 11:48:57 AM [build] output target: static
2023-01-22T11:48:57.264058Z 11:48:57 AM [build] Collecting build info...
2023-01-22T11:48:57.265338Z 11:48:57 AM [build] Completed in 35ms.
2023-01-22T11:48:57.266497Z 11:48:57 AM [build] Building static entrypoints...
2023-01-22T11:48:59.676768Z 11:48:59 AM [build] Completed in 2.41s.
2023-01-22T11:48:59.677146Z
2023-01-22T11:48:59.677301Z building client
2023-01-22T11:49:05.880946Z
2023-01-22T11:49:05.881295Z (!) Some chunks are larger than 500 KiB after minification. Consider:
2023-01-22T11:49:05.881462Z - Using dynamic import() to code-split the application
2023-01-22T11:49:05.881619Z - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
2023-01-22T11:49:05.881757Z - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
2023-01-22T11:49:05.881879Z Completed in 6.20s.
2023-01-22T11:49:05.881988Z
2023-01-22T11:49:05.882095Z
2023-01-22T11:49:05.882205Z generating static routes
2023-01-22T11:49:06.771913Z ▶ src/pages/index.astro
2023-01-22T11:49:06.78602Z └─ /index.html (+14ms)
2023-01-22T11:49:06.78633Z ▶ src/pages/blog/index.astro
2023-01-22T11:49:06.872802Z @notionhq/client warn: request fail {
2023-01-22T11:49:06.873183Z code: 'object_not_found',
2023-01-22T11:49:06.873355Z message: 'Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.'
2023-01-22T11:49:06.873487Z }
2023-01-22T11:49:06.88237Z @notionhq/client warn: request fail {
2023-01-22T11:49:06.88265Z code: 'object_not_found',
2023-01-22T11:49:06.882798Z message: 'Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.'
2023-01-22T11:49:06.88293Z }
2023-01-22T11:49:06.88423Z @notionhq/client warn: request fail {
2023-01-22T11:49:06.88443Z code: 'object_not_found',
2023-01-22T11:49:06.884567Z message: 'Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.'
2023-01-22T11:49:06.884712Z }
2023-01-22T11:49:06.887358Z @notionhq/client warn: request fail {
2023-01-22T11:49:06.887543Z code: 'object_not_found',
2023-01-22T11:49:06.887688Z message: 'Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.'
2023-01-22T11:49:06.887809Z }
2023-01-22T11:49:07.153966Z error Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.
2023-01-22T11:49:07.154564Z File:
2023-01-22T11:49:07.154808Z /opt/buildhome/repo/node_modules/@notionhq/client/build/src/errors.js:162:16
2023-01-22T11:49:07.154944Z Code:
2023-01-22T11:49:07.155098Z 161 | if (apiErrorResponseBody !== undefined) {
2023-01-22T11:49:07.155223Z > 162 | return new APIResponseError({
2023-01-22T11:49:07.155353Z | ^
2023-01-22T11:49:07.155474Z 163 | code: apiErrorResponseBody.code,
2023-01-22T11:49:07.155602Z 164 | message: apiErrorResponseBody.message,
2023-01-22T11:49:07.155739Z 165 | headers: response.headers,
2023-01-22T11:49:07.155866Z Stacktrace:
2023-01-22T11:49:07.156024Z APIResponseError: Could not find database with ID: 63156ec7-4870-4bf9-b55e-33eeaaac0c5e. Make sure the relevant pages and databases are shared with your integration.
2023-01-22T11:49:07.156303Z at buildRequestError (/opt/buildhome/repo/node_modules/@notionhq/client/build/src/errors.js:162:16)
2023-01-22T11:49:07.156501Z at Client.request (/opt/buildhome/repo/node_modules/@notionhq/client/build/src/Client.js:347:54)
2023-01-22T11:49:07.156708Z at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-01-22T11:49:07.156866Z at async getAllPosts (file:///opt/buildhome/repo/dist/entry.mjs?time=1674388145881:1946:17)
2023-01-22T11:49:07.157014Z at async getPosts (file:///opt/buildhome/repo/dist/entry.mjs?time=1674388145881:1957:20)
2023-01-22T11:49:07.157164Z at async Promise.all (index 0)
2023-01-22T11:49:07.157304Z at async file:///opt/buildhome/repo/dist/entry.mjs?time=1674388145881:2615:53
2023-01-22T11:49:07.157443Z at async renderPage (file:///opt/buildhome/repo/node_modules/astro/dist/runtime/server/render/page.js:89:30)
2023-01-22T11:49:07.157625Z at async renderPage (file:///opt/buildhome/repo/node_modules/astro/dist/core/render/core.js:86:20)
2023-01-22T11:49:07.157803Z at async generatePath (file:///opt/buildhome/repo/node_modules/astro/dist/core/build/generate.js:285:22)
2023-01-22T11:49:07.157921Z
2023-01-22T11:49:07.201414Z Failed: build command exited with code: 1
2023-01-22T11:49:08.323966Z Failed: an internal error occurred

Instructions missing

There is something missing from the "deploy manually" instructions. After following the instructions for settings, the "actions" screen did not look as in the instructions and I was not able to deploy.

VSCode + Astro公式拡張 でエラーが発生

不具合の概要

利用させていただいております。
動作自体は問題なくできているのですが、
VSCode + Astro公式拡張 で開発をしていると型の指定漏れ、型の不一致、インポートの記述、必要な引数の指定漏れ等で大量のエラーが発生してしまいます。

image

再現方法

  1. VSCodeを開く
  2. Astro公式プラグインをインストール
  3. .astroや.tsファイルを開く

エラーログ

添付画像(一部)

期待する挙動

エラーが発生しないようにしたい

デスクトップ環境

  • OS: MacOS

ビルド高速化機能の検証に参加する方法

ビルド高速化機能の検証にご参加いただきありがとうございます。
この機能は astro-notin-blog にとって重要で複雑な機能であるため、リリース前に検証したいと思っています。
検証にご協力いただける方は、後述の手順を実行し最後に下記をご報告ください。

期間

2023/2/3(金)まで(予定)

報告いただく内容

  1. ビルドの成否
    • エラーの場合はエラーメッセージの内容
    • デバッグに協力いただけるか否か
  2. ビルドしたブログの記事数とビルドにかかった時間
  3. 手順でわかりにくかったところ

機能の概要

  • ブロックを取得するNotion APIレスポンスのキャッシュ(Nx Cloudを使用)
  • 画像、ブックマークページの並列取得
  • 外部URL取得時のタイムアウト追加

検証手順

ローカルの開発環境はすでにあるものとします。
ブランチ feature-speedup-build #21 をローカルにチェックアウトします。

  1. 下記コマンドを実行し Nx Cloud のアクセストークンを生成します
yarn install && yarn nx g @nrwl/nx-cloud:init
  1. プロジェクトルートにある nx.json を開き accessToken の値をメモします
  2. 下記コマンドを実行して nx.json から accessToken を削除します
git checkout -- nx.json
  1. ブラウザで Nx Cloud を開いてアカウントを作成しサインインします
  2. "Connect a Workspace" を選択します

  1. "01 Check for Nx Cloud package" で "Yes, I'm using @nrwl/nx-cloud" を選択します

  1. "03 Setup The Access Token" でメモした accessToken を入力し "Connect The Workspace" を選択します

  1. "View Your Workspace" を選択したら一度ターミナルに戻ります
  2. NOTION_API_SECRET が正しくセットされていることを確認します
echo $NOTION_API_SECRET

設定されていなければ下記のように設定します。

export NOTION_API_SECRET=<YOUR_NOTION_API_SECRET>
  1. DATABASE_ID が Cloudflare Pages のビルド環境と同じであることを確認します
echo $DATABASE_ID

異なる場合は同じ値を設定します。

export DATABASE_ID=<YOUR_DATABASE_ID>
  1. メモした accessToken を環境変数 NX_CLOUD_ACCESS_TOKEN に設定し、コマンドを実行してキャッシュを生成します
    • 記事数約300で20~30分程度時間がかかります

NX_CLOUD_ACCESS_TOKEN を環境変数にセットし、正しくセットされていることを確認します。

export NX_CLOUD_ACCESS_TOKEN=<メモしたaccessToken>
echo $NX_CLOUD_ACCESS_TOKEN

キャッシュを生成します。

yarn cache:fetch
  1. 再度コマンドを実行しキャッシュが生成されているか確認します(正常にキャッシュが生成されていると今回は実行が速くなります)
    • キャッシュは Notion Page の last_edited_time を見て以降は自動で更新されるため、この操作は再度行う必要はありません
yarn cache:fetch
  1. ブラウザで Nx Cloud の Workspace を開きキャッシュの結果が "Local Cache Hit" になっていることを確認します

  1. 下記コマンドを実行してローカルでビルドし、かかった時間を報告してください(ローカルビルド)
yarn build:cached
  1. Cloudflare Pages のダッシュボードから環境変数を開きメモしたアクセストークンを NX_CLOUD_ACCESS_TOKEN として Production と Preview の両方に追加します

  1. ビルド設定を開きます

  1. "Build command" を下記に変更して保存します
npm run build:cached

  1. ブランチを GitHub に push してデプロイし、Nx Cloud でキャッシュの結果が "Remote Cache Hit" になっていることを確認します
    • ビルドにかかった時間をご報告ください(リモートビルド)

  1. 検証が終了したらステップ17で設定したビルドコマンドをデフォルトの npm run build に戻し、ローカルで書きコマンドを実行してキャッシュを削除します
yarn cache:purge

コピーボタンの文字列を元に戻す

プルリクするほどでもないかなと思いましたのでこちらに失礼します。

コピーをボタンを押した際に"copied!"のままになってしまうので、数秒後"Copy"に戻す処理があったらいいなと思いました。

src/components/notion-blocks/Code.astro

<script>
  document.querySelectorAll('button.copy').forEach((button) => {
    button.addEventListener('click', (ev) => {
      navigator.clipboard
        .writeText(ev.target.getAttribute('data-code'))
        .then(() => {
          ev.target.innerText = ev.target.getAttribute('data-done-text')
        }), r()
        function r() {
          setTimeout(function () {
            ev.target.innerText = 'Copy'
          }, 5000)
        }
    })
  })
</script>

いつも開発ありがとうございます!

I got a update error afer I modified a file.

Describe the bug

I add a Comments.astro file in component directory, and I modified the [slug].astro. When I commit the files , github give me some error like this:
image
image
So I updated the lint.yml like this
steps: - name: Check out Git repository uses: actions/checkout@v3 with: node-version: 16
Then I recommit the files and it continue to report error:
image

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'src/pages/post/[slug].astro'
  2. Click on 'edit this file' and make some change on it.
  3. Commit and it report error
    image

Cloudflareのデプロイでエラー出ました

不具合の概要

何も変更していません。
Cloudflareでデプロイしてみました。エラー出ました。

再現方法

クローンしてCloudflareでデプロイしてみましたがエラー出ました。

デプロイまでできており公開された URL で不具合が確認できる場合には URL も記載します。

エラーログ

2023-01-22T05:11:57.42198Z Cloning repository...
2023-01-22T05:11:58.282906Z From https://github.com/nuovotaka/astro-notion-blog
2023-01-22T05:11:58.283506Z * branch 429c0a02fa515c7f342216afe42efe73e0080631 -> FETCH_HEAD
2023-01-22T05:11:58.283718Z
2023-01-22T05:11:58.338632Z HEAD is now at 429c0a0 initial
2023-01-22T05:11:58.339157Z
2023-01-22T05:11:58.483519Z
2023-01-22T05:11:58.51169Z Success: Finished cloning repository files
2023-01-22T05:11:59.203908Z Installing dependencies
2023-01-22T05:11:59.215826Z Python version set to 2.7
2023-01-22T05:12:02.73571Z Downloading and installing node v16.13.0...
2023-01-22T05:12:03.159275Z Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
2023-01-22T05:12:03.580235Z Computing checksum with sha256sum
2023-01-22T05:12:03.707132Z Checksums matched!
2023-01-22T05:12:07.90891Z Now using node v16.13.0 (npm v8.1.0)
2023-01-22T05:12:08.301923Z Started restoring cached build plugins
2023-01-22T05:12:08.315485Z Finished restoring cached build plugins
2023-01-22T05:12:08.810047Z Attempting ruby version 2.7.1, read from environment
2023-01-22T05:12:12.433213Z Using ruby version 2.7.1
2023-01-22T05:12:12.796385Z Using PHP version 5.6
2023-01-22T05:12:12.960641Z 5.2 is already installed.
2023-01-22T05:12:12.987387Z Using Swift version 5.2
2023-01-22T05:12:12.988017Z Started restoring cached node modules
2023-01-22T05:12:13.003762Z Finished restoring cached node modules
2023-01-22T05:12:13.011566Z Started restoring cached yarn cache
2023-01-22T05:12:13.025801Z Finished restoring cached yarn cache
2023-01-22T05:12:13.045552Z Installing yarn at version 1.22.4
2023-01-22T05:12:13.064391Z �[37mInstalling Yarn!�[0m
2023-01-22T05:12:13.0647Z �[36m> Downloading tarball...�[0m
2023-01-22T05:12:13.108244Z
2023-01-22T05:12:13.108592Z [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.pUAplRQmvC
2023-01-22T05:12:13.109202Z % Total % Received % Xferd Average Speed Time Time Time Current
2023-01-22T05:12:13.109761Z Dload Upload Total Spent Left Speed
2023-01-22T05:12:13.381239Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 79 100 79 0 0 290 0 --:--:-- --:--:-- --:--:-- 291
2023-01-22T05:12:13.516413Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 93 100 93 0 0 228 0 --:--:-- --:--:-- --:--:-- 15500
2023-01-22T05:12:13.920563Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2023-01-22T05:12:14.250068Z
100 1215k 100 1215k 0 0 1065k 0 0:00:01 0:00:01 --:--:-- 1065k
2023-01-22T05:12:14.250371Z
2023-01-22T05:12:14.250669Z [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.pUAplRQmvC.asc
2023-01-22T05:12:14.285605Z
100 83 100 83 0 0 2406 0 --:--:-- --:--:-- --:--:-- 2406
2023-01-22T05:12:14.288292Z
100 96 100 96 0 0 2583 0 --:--:-- --:--:-- --:--:-- 2583
2023-01-22T05:12:14.29765Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2023-01-22T05:12:14.376502Z
100 1028 100 1028 0 0 8198 0 --:--:-- --:--:-- --:--:-- 8198
2023-01-22T05:12:14.42374Z �[36m> Verifying integrity...�[0m
2023-01-22T05:12:14.468009Z gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
2023-01-22T05:12:14.474165Z gpg: Good signature from "Yarn Packaging [email protected]"
2023-01-22T05:12:14.476644Z gpg: Note: This key has expired!
2023-01-22T05:12:14.476924Z Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
2023-01-22T05:12:14.477109Z Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
2023-01-22T05:12:14.477738Z �[32m> GPG signature looks good�[0m
2023-01-22T05:12:14.477962Z �[36m> Extracting to ~/.yarn...�[0m
2023-01-22T05:12:14.572095Z �[36m> Adding to $PATH...�[0m
2023-01-22T05:12:14.599738Z �[36m> We've added the following to your /opt/buildhome/.bashrc
2023-01-22T05:12:14.600053Z > If this isn't the profile of your current shell then please add the following to your correct profile:
2023-01-22T05:12:14.600223Z
2023-01-22T05:12:14.600343Z export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2023-01-22T05:12:14.600458Z �[0m
2023-01-22T05:12:14.986451Z �[32m> Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.�[0m
2023-01-22T05:12:15.389015Z Installing NPM modules using Yarn version 1.22.4
2023-01-22T05:12:16.096626Z yarn install v1.22.4
2023-01-22T05:12:16.184024Z [1/4] Resolving packages...
2023-01-22T05:12:16.43334Z [2/4] Fetching packages...
2023-01-22T05:12:31.832887Z warning [email protected]: The engine "pnpm" appears to be invalid.
2023-01-22T05:12:31.834802Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.83515Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.835968Z info @esbuild/[email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.836203Z info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.836342Z info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.836469Z info @esbuild/[email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.836602Z info "@esbuild/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.836758Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.836874Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.836982Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.837098Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.837216Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.837352Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.837463Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.837589Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.837696Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.837811Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.837917Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.838036Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.838154Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.838262Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.838373Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.838489Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.838601Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.838707Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.838816Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.838923Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.839029Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.839143Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.839259Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.839374Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.839495Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.839608Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.839721Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.839826Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.839931Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.840046Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.840168Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.840288Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.840398Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.840514Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.840625Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.840732Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.840839Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.840955Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.841067Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.841181Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.841288Z info [email protected]: The platform "linux" is incompatible with this module.
2023-01-22T05:12:31.841405Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-01-22T05:12:31.841526Z info [email protected]: The CPU architecture "x64" is incompatible with this module.
2023-01-22T05:12:31.850264Z [3/4] Linking dependencies...
2023-01-22T05:12:31.852252Z warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react@^17.0.50 || ^18.0.21".
2023-01-22T05:12:31.852679Z warning " > @astrojs/[email protected]" has unmet peer dependency "@types/react-dom@^17.0.17 || ^18.0.6".
2023-01-22T05:12:31.854492Z warning "@typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
2023-01-22T05:12:42.115097Z [4/4] Building fresh packages...
2023-01-22T05:12:43.577705Z Done in 27.49s.
2023-01-22T05:12:43.607966Z NPM modules installed using Yarn
2023-01-22T05:12:43.900672Z Installing Hugo 0.54.0
2023-01-22T05:12:44.592211Z Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2023-01-22T05:12:44.596157Z Started restoring cached go cache
2023-01-22T05:12:44.615749Z Finished restoring cached go cache
2023-01-22T05:12:44.757346Z go version go1.14.4 linux/amd64
2023-01-22T05:12:44.773234Z go version go1.14.4 linux/amd64
2023-01-22T05:12:44.777001Z Installing missing commands
2023-01-22T05:12:44.777263Z Verify run directory
2023-01-22T05:12:44.777404Z Executing user command: npm run build
2023-01-22T05:12:45.227739Z
2023-01-22T05:12:45.228096Z > [email protected] build
2023-01-22T05:12:45.228257Z > astro build
2023-01-22T05:12:45.228388Z
2023-01-22T05:12:47.230115Z 05:12:47 AM [build] output target: static
2023-01-22T05:12:47.230546Z 05:12:47 AM [build] Collecting build info...
2023-01-22T05:12:47.231764Z 05:12:47 AM [build] Completed in 27ms.
2023-01-22T05:12:47.232828Z 05:12:47 AM [build] Building static entrypoints...
2023-01-22T05:12:49.561353Z 05:12:49 AM [build] Completed in 2.33s.
2023-01-22T05:12:49.561725Z
2023-01-22T05:12:49.56187Z building client
2023-01-22T05:12:55.586029Z
2023-01-22T05:12:55.586354Z (!) Some chunks are larger than 500 KiB after minification. Consider:
2023-01-22T05:12:55.586519Z - Using dynamic import() to code-split the application
2023-01-22T05:12:55.586643Z - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
2023-01-22T05:12:55.586756Z - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
2023-01-22T05:12:55.586871Z Completed in 6.02s.
2023-01-22T05:12:55.587064Z
2023-01-22T05:12:55.587289Z
2023-01-22T05:12:55.58743Z generating static routes
2023-01-22T05:12:56.445544Z ▶ src/pages/index.astro
2023-01-22T05:12:56.459601Z └─ /index.html (+14ms)
2023-01-22T05:12:56.459986Z ▶ src/pages/blog/index.astro
2023-01-22T05:12:57.815651Z error Cannot read properties of undefined (reading 'files')
2023-01-22T05:12:57.816139Z File:
2023-01-22T05:12:57.816322Z /opt/buildhome/repo/node_modules/astro/dist/runtime/server/render/page.js:89:30
2023-01-22T05:12:57.816445Z Code:
2023-01-22T05:12:57.816573Z 88 | }
2023-01-22T05:12:57.816699Z > 89 | const factoryReturnValue = await componentFactory(result, props, children);
2023-01-22T05:12:57.81681Z | ^
2023-01-22T05:12:57.816919Z 90 | const factoryIsHeadAndContent = isHeadAndContent(factoryReturnValue);
2023-01-22T05:12:57.817029Z 91 | if (isRenderTemplateResult(factoryReturnValue) || factoryIsHeadAndContent) {
2023-01-22T05:12:57.817165Z 92 | await bufferHeadContent(result);
2023-01-22T05:12:57.817322Z Stacktrace:
2023-01-22T05:12:57.817492Z TypeError: Cannot read properties of undefined (reading 'files')
2023-01-22T05:12:57.817655Z at _buildPost (file:///opt/buildhome/repo/dist/entry.mjs?time=1674364375586:2360:39)
2023-01-22T05:12:57.817783Z at file:///opt/buildhome/repo/dist/entry.mjs?time=1674364375586:1953:92
2023-01-22T05:12:57.817898Z at Array.map ()
2023-01-22T05:12:57.818011Z at getAllPosts (file:///opt/buildhome/repo/dist/entry.mjs?time=1674364375586:1953:72)
2023-01-22T05:12:57.818129Z at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-01-22T05:12:57.818237Z at async getNumberOfPages (file:///opt/buildhome/repo/dist/entry.mjs?time=1674364375586:2001:20)
2023-01-22T05:12:57.818347Z at async Promise.all (index 3)
2023-01-22T05:12:57.818456Z at async file:///opt/buildhome/repo/dist/entry.mjs?time=1674364375586:2609:53
2023-01-22T05:12:57.818586Z at async renderPage (file:///opt/buildhome/repo/node_modules/astro/dist/runtime/server/render/page.js:89:30)
2023-01-22T05:12:57.818706Z at async renderPage (file:///opt/buildhome/repo/node_modules/astro/dist/core/render/core.js:86:20)
2023-01-22T05:12:57.818825Z
2023-01-22T05:12:57.858695Z Failed: build command exited with code: 1
2023-01-22T05:12:58.739072Z Failed: an internal error occurred

リポジトリとブランチ名

もし Fork した easy-notion-blog でエラーが発生している場合には、あなたのリポジトリの URL とブランチ名を記載します。

デスクトップ環境

  • OS: [ MacOS]
  • ブラウザ: [Brave]
  • ブラウザのバージョン: [1.47.171]

[Spec] Support File blocks

Definition

  1. API endpoint is defined in src/pages/api/blocks/[id].ts
    • The endpoint is used for fetching the file URL(S3 signed URL) of the File blocks if the URL is expired
    • The endpoint allows GET /api/blocks/:id as a request
    • The endpoint returns JSON data of the block if the block type is 'file'
      • if the block type is not 'file', the endpoint respond 403 for security reasons
  2. Component is defined in src/components/notion-blocks/File.astro
    • The component displays a download link to the file like #51
    • The component make a request to the API to refresh the URL from front-end
    • The request is made IF...
      • the file URL is expired
      • the download link is clicked

Tips

  • The download link element should have the expiry time in a data attribute like data-expiry-time="2023-02-13T..."

TODO

  • Install adapter for Cloudflare worker
  • Add an API endpoint as /api/blocks/[id].ts
  • Define src/components/notion-blocks/File.astro

インラインコード末尾の半角スペース

文章中にインラインコードマークを入れたときに末尾に不自然な半角スペースが挿入されてしまいます。

code-inline

src/components/notion-blocks/annotations/Code.astro を修正すればいいのですが、Prettierにかけると整形されてしまうため元に戻ってしまいます。

annotation-code

なにか解決方法がありましたらお願いいたします。

Bug: localhostで起動すると、Cannot read properties of undefined (reading 'title')になる

不具合の概要

過去Closedされたissueに同じようなものがあったようにも見受けられるのですが
Cannot read properties of undefined (reading 'title')
になり、TableOfContents以外でも発生(column_listlink_previewなど)しております… ><
スクリーンショット 2023-01-29 4 29 26

Notion DB側の問題の可能性もあるので自分でも引き続き調べてみます👀

再現方法

  1. 本Repositoryをclone
  2. .envを入れて、yarn install && yarn dev
  3. 'http://localhost:3000/blog' を開く
  4. 添付画像のエラーが発生する

エラーログ

 error   Cannot read properties of undefined (reading 'title')
  File:
    /Users/harunon/astro/astro-notion-blog/src/lib/notion/client.ts:458:22
  Code:
    457 |         block.TableOfContents = tableOfContents
    > 458 |       }
          |                      ^
      459 |       break
      460 |   }
  Stacktrace:
TypeError: Cannot read properties of undefined (reading 'title')
    at _validPageObject (/src/lib/notion/client.ts:458:22)
    at eval (/src/lib/notion/client.ts:50:42)
    at Array.filter (<anonymous>)
    at getAllPosts (/src/lib/notion/client.ts:50:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.getAllTags (/src/lib/notion/client.ts:171:20)
    at async Promise.all (index 2)
    at async eval (/Users/harunon/astro/astro-notion-blog/src/pages/blog/index.astro:38:53)
    at async renderPage (file:///Users/harunon/astro/astro-notion-blog/node_modules/astro/dist/runtime/server/render/page.js:89:30)
    at async renderPage (file:///Users/harunon/astro/astro-notion-blog/node_modules/astro/dist/core/render/core.js:86:20)

04:33:34 AM [serve]    404                                   /sw.js (x2)

期待する挙動

/blog に正常に表示される

スクリーンショット

スクリーンショット 2023-01-29 4 29 26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.