otoyo / easy-notion-blog

✍️ Let's start your own Notion Blog easily. / Notion Blogを始めましょう!

Home Page:https://easy-notion-blog-otoyo.vercel.app/blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vercelのデプロイで失敗します。助けて欲しいです。

ronginooth opened this issue · comments

不具合の概要

Vercelのデプロイで失敗する。

再現方法

下記のREADME.jaの手順に従い、Vercelでデプロイ
https://github.com/otoyo/easy-notion-blog/blob/main/README.ja.md

ただし手順の7のみ記述の意味がわからなかったので以下のように行った
Import Third-Party Git Repository →
からhttps://github.com/otoyo/easy-notion-blogを入力してContinue
Create Git Repositoryの中の
Git Scope: 自分のGit acount
Repository Name: easy-notion-blog
としてCreate
すると、環境変数を入力する前にDeployが始まり、失敗に終わりますが、
再度Environment Variablesの
key: NOTION_API_SECRET
Value: database ID
としてsaveしredeploymentするとやはり失敗に終わります。

エラーログ

以下のようになります。

16:18:08.630 Cloning github.com/ronginooth/easy-notion-blog (Branch: main, Commit: 6dca99f)
16:18:08.636 Skipping build cache since Vercel CLI used --force option
16:18:09.187 Cloning completed: 556.253ms
16:18:09.575 Running "vercel build"
16:18:10.079 Vercel CLI 28.10.3
16:18:10.387 Installing dependencies...
16:18:10.747 yarn install v1.22.17
16:18:10.816 [1/4] Resolving packages...
16:18:11.098 [2/4] Fetching packages...
16:18:31.085 warning swr@2.0.0: The engine "pnpm" appears to be invalid.
16:18:31.098 [3/4] Linking dependencies...
16:18:31.101 warning " > react-katex@3.0.1" has unmet peer dependency "prop-types@^15.8.1".
16:18:31.101 warning " > @typescript-eslint/eslint-plugin@5.46.1" has unmet peer dependency "@typescript-eslint/parser@^5.0.0".
16:18:52.973 [4/4] Building fresh packages...
16:18:54.258 Done in 43.52s.
16:18:54.293 Detected Next.js version: 13.0.7
16:18:54.295 Running "yarn run build"
16:18:54.564 yarn run v1.22.17
16:18:54.590 $ node scripts/set-blog-index-cache.js && next build && node scripts/expire-blog-index-cache.js
16:18:54.849 @notionhq/client warn: request fail { code: 'unauthorized', message: 'API token is invalid.' }
16:18:54.851 /vercel/path0/node_modules/@notionhq/client/build/src/errors.js:162
16:18:54.852 return new APIResponseError({
16:18:54.852 ^
16:18:54.852  
16:18:54.852 APIResponseError: API token is invalid.
16:18:54.852 at buildRequestError (/vercel/path0/node_modules/@notionhq/client/build/src/errors.js:162:16)
16:18:54.852 at Client.request (/vercel/path0/node_modules/@notionhq/client/build/src/Client.js:342:54)
16:18:54.852 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
16:18:54.852 at async exports.set (/vercel/path0/lib/notion/blog-index-cache.js:59:18) {
16:18:54.852 code: 'unauthorized',
16:18:54.852 status: 401,
16:18:54.852 headers: Headers {
16:18:54.853 [Symbol(map)]: [Object: null prototype] {
16:18:54.853 date: [ 'Sun, 08 Jan 2023 07:18:54 GMT' ],
16:18:54.853 'content-type': [ 'application/json; charset=utf-8' ],
16:18:54.853 'content-length': [ '87' ],
16:18:54.853 connection: [ 'close' ],
16:18:54.853 'set-cookie': [
16:18:54.853 'notion_browser_id=4c68d1ef-04cc-4345-b363-11ce4098fd8a; Domain=www.notion.so; Path=/; Expires=Mon, 08 Jan 2024 07:18:54 GMT; Secure',
16:18:54.853 'notion_check_cookie_consent=false; Domain=www.notion.so; Path=/; Expires=Mon, 09 Jan 2023 07:18:54 GMT; Secure'
16:18:54.853 ],
16:18:54.853 'content-security-policy': [
16:18:54.856 "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://www.notion.so https://api.embed.ly https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so https://api.box.com https://.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://.mux.com;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net;media-src blob: https: http: https://file.notion.so https://*.mux.com;worker-src blob:;frame-
16:18:54.856 ],
16:18:54.856 'x-dns-prefetch-control': [ 'off' ],
16:18:54.857 'x-frame-options': [ 'SAMEORIGIN' ],
16:18:54.857 'strict-transport-security': [ 'max-age=5184000; includeSubDomains' ],
16:18:54.857 'x-download-options': [ 'noopen' ],
16:18:54.857 'x-content-type-options': [ 'nosniff' ],
16:18:54.857 'x-permitted-cross-domain-policies': [ 'none' ],
16:18:54.857 'referrer-policy': [ 'strict-origin-when-cross-origin' ],
16:18:54.857 'x-xss-protection': [ '0' ],
16:18:54.857 etag: [ 'W/"57-QCRLT3IovYEW+CkwyJQlFtiXiG8"' ],
16:18:54.857 vary: [ 'Accept-Encoding' ],
16:18:54.857 'cf-cache-status': [ 'DYNAMIC' ],
16:18:54.857 server: [ 'cloudflare' ],
16:18:54.857 'cf-ray': [ '7863297048a82c90-ORD' ]
16:18:54.857 }
16:18:54.857 },
16:18:54.857 body: '{"object":"error","status":401,"code":"unauthorized","message":"API token is invalid."}'
16:18:54.858 }
16:18:54.858  
16:18:54.858 Node.js v18.12.1
16:18:54.871 error Command failed with exit code 1.
16:18:54.871 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:18:54.892 Error: Command "yarn run build" exited with 1

他に必要な情報などあれば合わせてご教授願います!
よろしくお願いいたしますー!

再度Environment Variablesの
key: NOTION_API_SECRET
Value: database ID

key: NOTION_API_SECRET
value: Notionのインテグレーションで取得した値

key: DATABASE_ID
value: Notionのテンプレートを複製したページのURLの一部分の英数字の羅列

それぞれの設定を行ってみてください。

スクリーンショット 2023-01-08 17 49 29

@ronginooth easy-notion-blog をお使いくださりありがとうございます。 👆 のように設定してみてください。
NOTION_API_SECRET に設定する値は https://www.notion.so/my-integrations にアクセスしてインテグレーションを表示→シークレット→表示→コピーで得られます。
DATABASE_ID は手順3で得たものを value に設定してください。

Environment Variables は NOTION_API_SECRETDATABASE_ID の2つを設定する必要があるということです。

お教えいただいた通りにしたらうまくいきました!
ブログもできました!今後ともよろしくお願いします。
https://easy-notion-blog-ronginooth.vercel.app/blog
ロンギ

無事できてよかったです!