【发布时间】:2022-08-20 02:20:52
【问题描述】:
当我在 vercel.com 中部署项目时,出现此错误:
问题的关键是\"request fail { code: \'unauthorized\', message: \'API token is invalid.\' }\",导致部署不成功
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js\' roadmap and prioritize features.
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:
https://nextjs.org/telemetry
info - Checking validity of types...
info - Creating an optimized production build...
info - Compiled successfully
info - Collecting page data...
@notionhq/client warn: request fail { code: \'unauthorized\', message: \'API token is invalid.\' }
> Build error occurred
Error [APIResponseError]: API token is invalid.
at buildRequestError (/vercel/path0/node_modules/.pnpm/@notionhq+client@1.0.4/node_modules/@notionhq/client/build/src/errors.js:162:16)
at Client.request (/vercel/path0/node_modules/.pnpm/@notionhq+client@1.0.4/node_modules/@notionhq/client/build/src/Client.js:304:54)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async getDatabase (/vercel/path0/.next/server/chunks/312.js:49:22)
at async getStaticPaths (/vercel/path0/.next/server/pages/blog/[slug].js:880:16)
at async buildStaticPaths (/vercel/path0/node_modules/.pnpm/next@12.1.6_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/next/dist/build/utils.js:491:31)
at async /vercel/path0/node_modules/.pnpm/next@12.1.6_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/next/dist/build/utils.js:632:119
at async Span.traceAsyncFn (/vercel/path0/node_modules/.pnpm/next@12.1.6_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/next/dist/trace/trace.js:79:20) {
type: \'APIResponseError\',
code: \'unauthorized\',
status: 401,
headers: {},
body: \'{\"object\":\"error\",\"status\":401,\"code\":\"unauthorized\",\"message\":\"API token is invalid.\"}\'
}
ELIFECYCLE Command failed with exit code 1.
Error! Command \"pnpm run build\" exited with 1
标签: vercel