0

I tried to deploy my portfolio/Blog on Vercel, but for some reasons, it doesn't work. I'm relatively new with Vercel and I'm not sure what's the problem.

Vercel is not really explicit about what to do with the "Error: Command "yarn run build" exited with 1".

I also noticed an API responsed error which I don't understand. Everything is ok in my .env variable...

Cloning github.com/lmssr/notionProtfolioBLog (Branch: master, Commit: ea8ebdf)
Cloning completed: 4.855s
Analyzing source code...
Installing build runtime...
Build runtime installed: 2.631s
No Build Cache available
Installing dependencies...
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @chakra-ui/icons@1.1.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
warning "@chakra-ui/icons > @chakra-ui/icon@1.2.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
warning "@emotion/styled > @emotion/babel-plugin@11.7.2" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.7" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > tsutils@3.21.0" 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".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 26.67s.
Detected Next.js version: 11.1.3
Running "yarn run build"
yarn run v1.22.17
$ next build
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
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...
error - ESLint: ESLint configuration in .eslintrc is invalid:   - Unexpected top-level property "react/no-unescaped-entities". 
info  - Creating an optimized production build...
warn  - Compiled with warnings
./src/pages/404.js
export 'getInitialProps' (reexported as 'getInitialProps') was not found in '../components/chakra' (possible exports: default, getServerSideProps)
./src/pages/404.js
export 'getInitialProps' (reexported as 'getInitialProps') was not found in '../components/chakra' (possible exports: default, getServerSideProps)
info  - Collecting page data...
Client warn: request fail { code: 'unauthorized', message: 'API token is invalid.' }
> Build error occurred
Error [APIResponseError]: API token is invalid.
    at Object.buildRequestError (/vercel/path0/node_modules/@notionhq/client/build/src/errors.js:79:20)
    at Client.request (/vercel/path0/node_modules/@notionhq/client/build/src/Client.js:206:43)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async getPosts (/vercel/path0/.next/server/chunks/493.js:23:20)
    at async getStaticPaths (/vercel/path0/.next/server/pages/post/[slug].js:209:17)
    at async buildStaticPaths (/vercel/path0/node_modules/next/dist/build/utils.js:472:31)
    at async /vercel/path0/node_modules/next/dist/build/utils.js:615:119
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:60:20) {
  type: 'APIResponseError',
  code: 'unauthorized',
  status: 401,
  headers: {
    date: 'Thu, 27 Jan 2022 17:34:39 GMT',
    'content-type': 'application/json; charset=utf-8',
    'content-length': '87',
    connection: 'close',
    'set-cookie': [
      'notion_browser_id=9d919bb4-7811-47d6-91f1-06fe0176b012; Domain=www.notion.so; Path=/; Expires=Fri, 27 Jan 2023 17:34:39 GMT; Secure',
      'notion_experiment_device_id=73fc666a-d730-4c35-9a68-ca93986c6d82; Domain=www.notion.so; Path=/; Expires=Fri, 27 Jan 2023 17:34:39 GMT; Secure',
      'notion_check_cookie_consent=false; Domain=www.notion.so; Path=/; Expires=Fri, 28 Jan 2022 17:34:39 GMT; Secure'
    ],
    'x-dns-prefetch-control': 'off',
    'x-frame-options': 'SAMEORIGIN',
    'strict-transport-security': 'max-age=5184000; includeSubDomains',
    'x-download-options': 'noopen',
    'x-content-type-options': 'nosniff',
    'x-xss-protection': '1; mode=block',
    'referrer-policy': 'same-origin',
    'content-security-policy': "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://widget.intercom.io https://js.intercomcdn.com https://logs-01.loggly.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 js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com; connect-src 'self' 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: http: https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://api.embed.ly https://js.intercomcdn.com https://api-iam.intercom.io wss://nexus-websocket-a.intercom.io https://logs-01.loggly.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://api.statuspage.io https://pgncd.notion.so https://api.statsig.com; font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com; img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.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; frame-src https: http:; media-src https: http:",
    'x-content-security-policy': "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://widget.intercom.io https://js.intercomcdn.com https://logs-01.loggly.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 js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com; connect-src 'self' 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: http: https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://api.embed.ly https://js.intercomcdn.com https://api-iam.intercom.io wss://nexus-websocket-a.intercom.io https://logs-01.loggly.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://api.statuspage.io https://pgncd.notion.so https://api.statsig.com; font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com; img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.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; frame-src https: http:; media-src https: http:",
    etag: 'W/"57-QCRLT3IovYEW+CkwyJQlFtiXiG8"',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'DYNAMIC',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    server: 'cloudflare',
    'cf-ray': '6d43bba4ab1170ec-SJC'
  },
  body: '{"object":"error","status":401,"code":"unauthorized","message":"API token is invalid."}'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
1
  • "Error [APIResponseError]: API token is invalid." - are you using a valid API token to make requests against whatever API you're using (Notion API, I assume)? Providing some code on how you're accessing the API in /pages/post/[slug].js would help debugging the issue. Jan 29, 2022 at 14:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.