9:29:34 AM: Build ready to start 9:29:36 AM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal) 9:29:36 AM: build-image tag: v4.5.3 9:29:36 AM: buildbot version: 45faaf324677495f3400b572da79977ab3212265 9:29:36 AM: Fetching cached dependencies 9:29:36 AM: Failed to fetch cache, continuing with build 9:29:36 AM: Starting to prepare the repo for build 9:29:36 AM: No cached dependencies found. Cloning fresh repo 9:29:36 AM: git clone https://github.com/lmssr/notionProtfolioBLog 9:29:40 AM: Preparing Git Reference refs/heads/master 9:29:41 AM: Parsing package.json dependencies 9:29:42 AM: Starting build script 9:29:42 AM: Installing dependencies 9:29:42 AM: Python version set to 2.7 9:29:43 AM: v16.13.2 is already installed. 9:29:43 AM: Now using node v16.13.2 (npm v8.1.2) 9:29:43 AM: Started restoring cached build plugins 9:29:43 AM: Finished restoring cached build plugins 9:29:43 AM: Attempting ruby version 2.7.2, read from environment 9:29:45 AM: Using ruby version 2.7.2 9:29:45 AM: Using PHP version 8.0 9:29:45 AM: Started restoring cached yarn cache 9:29:45 AM: Finished restoring cached yarn cache 9:29:46 AM: No yarn workspaces detected 9:29:46 AM: Started restoring cached node modules 9:29:46 AM: Finished restoring cached node modules 9:29:46 AM: Installing NPM modules using Yarn version 1.22.10 9:29:47 AM: yarn install v1.22.10 9:29:47 AM: 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. 9:29:47 AM: [1/4] Resolving packages... 9:29:47 AM: [2/4] Fetching packages... 9:30:06 AM: info @next/swc-darwin-arm64@11.1.3: The platform "linux" is incompatible with this module. 9:30:06 AM: info "@next/swc-darwin-arm64@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 9:30:06 AM: info @next/swc-darwin-arm64@11.1.3: The CPU architecture "x64" is incompatible with this module. 9:30:06 AM: info @next/swc-darwin-x64@11.1.3: The platform "linux" is incompatible with this module. 9:30:06 AM: info "@next/swc-darwin-x64@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 9:30:06 AM: info @next/swc-win32-x64-msvc@11.1.3: The platform "linux" is incompatible with this module. 9:30:06 AM: info "@next/swc-win32-x64-msvc@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 9:30:06 AM: info fsevents@2.3.2: The platform "linux" is incompatible with this module. 9:30:06 AM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. 9:30:06 AM: [3/4] Linking dependencies... 9:30:06 AM: warning " > @chakra-ui/icons@1.1.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0". 9:30:06 AM: warning "@chakra-ui/icons > @chakra-ui/icon@1.2.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0". 9:30:06 AM: warning "@emotion/styled > @emotion/babel-plugin@11.7.2" has unmet peer dependency "@babel/core@^7.0.0". 9:30:06 AM: warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.7" has unmet peer dependency "@babel/core@^7.0.0-0". 9:30:06 AM: warning "next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0". 9:30:06 AM: 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". 9:30:14 AM: [4/4] Building fresh packages... 9:30:14 AM: success Saved lockfile. 9:30:14 AM: Done in 27.65s. 9:30:14 AM: NPM modules installed using Yarn 9:30:15 AM: Started restoring cached go cache 9:30:15 AM: Finished restoring cached go cache 9:30:15 AM: go version go1.16.5 linux/amd64 9:30:15 AM: go version go1.16.5 linux/amd64 9:30:15 AM: Installing missing commands 9:30:15 AM: Verify run directory 9:30:16 AM: β 9:30:16 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:16 AM: Netlify Build 9:30:16 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:16 AM: β 9:30:16 AM: β― Version 9:30:16 AM: @netlify/build 26.2.2 9:30:16 AM: β 9:30:16 AM: β― Flags 9:30:16 AM: baseRelDir: true 9:30:16 AM: buildId: 61f3a96e1b85077432a255d6 9:30:16 AM: deployId: 61f3a96e1b85077432a255d8 9:30:16 AM: β 9:30:16 AM: β― Current directory 9:30:16 AM: /opt/build/repo 9:30:16 AM: β 9:30:16 AM: β― Config file 9:30:16 AM: No config file was defined: using default values. 9:30:16 AM: β 9:30:16 AM: β― Context 9:30:16 AM: production 9:30:16 AM: β 9:30:16 AM: β― Installing plugins 9:30:16 AM: - @netlify/plugin-nextjs@4.2.1 9:30:28 AM: β 9:30:28 AM: β― Loading plugins 9:30:28 AM: - @netlify/plugin-nextjs@4.2.1 from Netlify app 9:30:29 AM: β 9:30:29 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:29 AM: 1. @netlify/plugin-nextjs (onPreBuild event) 9:30:29 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:29 AM: β 9:30:29 AM: No Next.js cache to restore. 9:30:29 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed. 9:30:29 AM: β 9:30:29 AM: (@netlify/plugin-nextjs onPreBuild completed in 25ms) 9:30:29 AM: β 9:30:29 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:29 AM: 2. Build command from Netlify app 9:30:29 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:29 AM: β 9:30:29 AM: $ CI = npm run build 9:30:29 AM: bash: CI: command not found 9:30:30 AM: β 9:30:30 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:30 AM: "build.command" failed 9:30:30 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9:30:30 AM: β 9:30:30 AM: Error message 9:30:30 AM: Command failed with exit code 127: CI = npm run build 9:30:30 AM: β 9:30:30 AM: Error location 9:30:30 AM: In Build command from Netlify app: 9:30:30 AM: CI = npm run build 9:30:30 AM: β 9:30:30 AM: Resolved config 9:30:30 AM: build: 9:30:30 AM: command: CI = npm run build 9:30:30 AM: commandOrigin: ui 9:30:30 AM: environment: 9:30:30 AM: - NEXT_PRIVATE_TARGET 9:30:30 AM: publish: /opt/build/repo/.next 9:30:30 AM: publishOrigin: ui 9:30:30 AM: plugins: 9:30:30 AM: - inputs: {} 9:30:30 AM: origin: ui 9:30:30 AM: package: '@netlify/plugin-nextjs' 9:30:30 AM: Caching artifacts 9:30:30 AM: Started saving node modules 9:30:30 AM: Finished saving node modules 9:30:30 AM: Started saving build plugins 9:30:30 AM: Finished saving build plugins 9:30:30 AM: Started saving yarn cache 9:30:33 AM: Finished saving yarn cache 9:30:33 AM: Started saving pip cache 9:30:33 AM: Finished saving pip cache 9:30:33 AM: Started saving emacs cask dependencies 9:30:33 AM: Finished saving emacs cask dependencies 9:30:33 AM: Started saving maven dependencies 9:30:33 AM: Finished saving maven dependencies 9:30:33 AM: Started saving boot dependencies 9:30:33 AM: Finished saving boot dependencies 9:30:33 AM: Started saving rust rustup cache 9:30:33 AM: Finished saving rust rustup cache 9:30:33 AM: Started saving go dependencies 9:30:33 AM: Finished saving go dependencies 9:30:35 AM: Build failed due to a user error: Build script returned non-zero exit code: 2 9:30:35 AM: Creating deploy upload records 9:30:35 AM: Failing build: Failed to build site 9:30:35 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 9:30:35 AM: Finished processing build request in 59.562515808s
I tried to deploy my website, but for some reasons, it returns the error message βBuild failed due to a user error: Build script returned non-zero exit code: 2β. Everything work properly in local machine, but when i deploy on netlify, it is not. What could be the issue? Can someone guide?
Hello @coelmay, thanks for your answer ! I tried your solution, but I have axactly the same problem (it looks like the build stop further but with the same problem β¦)
10:27:06 AM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/lmssr/builds 10:28:57 AM: Build ready to start 10:28:58 AM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal) 10:28:58 AM: build-image tag: v4.5.3 10:28:58 AM: buildbot version: 45faaf324677495f3400b572da79977ab3212265 10:28:59 AM: Building without cache 10:28:59 AM: Starting to prepare the repo for build 10:28:59 AM: No cached dependencies found. Cloning fresh repo 10:28:59 AM: git clone https://github.com/lmssr/notionProtfolioBLog 10:29:02 AM: Preparing Git Reference refs/heads/master 10:29:03 AM: Parsing package.json dependencies 10:29:04 AM: Starting build script 10:29:04 AM: Installing dependencies 10:29:04 AM: Python version set to 2.7 10:29:05 AM: v16.13.2 is already installed. 10:29:05 AM: Now using node v16.13.2 (npm v8.1.2) 10:29:05 AM: Started restoring cached build plugins 10:29:05 AM: Finished restoring cached build plugins 10:29:06 AM: Attempting ruby version 2.7.2, read from environment 10:29:07 AM: Using ruby version 2.7.2 10:29:07 AM: Using PHP version 8.0 10:29:07 AM: Started restoring cached yarn cache 10:29:07 AM: Finished restoring cached yarn cache 10:29:08 AM: No yarn workspaces detected 10:29:08 AM: Started restoring cached node modules 10:29:08 AM: Finished restoring cached node modules 10:29:08 AM: Installing NPM modules using Yarn version 1.22.10 10:29:09 AM: yarn install v1.22.10 10:29:09 AM: 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. 10:29:09 AM: [1/4] Resolving packages... 10:29:09 AM: [2/4] Fetching packages... 10:29:30 AM: info @next/swc-darwin-arm64@11.1.3: The platform "linux" is incompatible with this module. 10:29:30 AM: info "@next/swc-darwin-arm64@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 10:29:30 AM: info @next/swc-darwin-arm64@11.1.3: The CPU architecture "x64" is incompatible with this module. 10:29:30 AM: info @next/swc-darwin-x64@11.1.3: The platform "linux" is incompatible with this module. 10:29:30 AM: info "@next/swc-darwin-x64@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 10:29:30 AM: info @next/swc-win32-x64-msvc@11.1.3: The platform "linux" is incompatible with this module. 10:29:30 AM: info "@next/swc-win32-x64-msvc@11.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 10:29:30 AM: info fsevents@2.3.2: The platform "linux" is incompatible with this module. 10:29:30 AM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. 10:29:30 AM: [3/4] Linking dependencies... 10:29:30 AM: warning " > @chakra-ui/icons@1.1.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0". 10:29:30 AM: warning "@chakra-ui/icons > @chakra-ui/icon@1.2.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0". 10:29:30 AM: warning "@emotion/styled > @emotion/babel-plugin@11.7.2" has unmet peer dependency "@babel/core@^7.0.0". 10:29:30 AM: warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.7" has unmet peer dependency "@babel/core@^7.0.0-0". 10:29:30 AM: warning "next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0". 10:29:30 AM: 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". 10:29:38 AM: [4/4] Building fresh packages... 10:29:39 AM: success Saved lockfile. 10:29:39 AM: Done in 30.46s. 10:29:39 AM: NPM modules installed using Yarn 10:29:39 AM: Started restoring cached go cache 10:29:39 AM: Finished restoring cached go cache 10:29:39 AM: go version go1.16.5 linux/amd64 10:29:40 AM: go version go1.16.5 linux/amd64 10:29:40 AM: Installing missing commands 10:29:40 AM: Verify run directory 10:29:41 AM: β 10:29:41 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:41 AM: Netlify Build 10:29:41 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:41 AM: β 10:29:41 AM: β― Version 10:29:41 AM: @netlify/build 26.2.2 10:29:41 AM: β 10:29:41 AM: β― Flags 10:29:41 AM: baseRelDir: true 10:29:41 AM: buildId: 61f3b6ea96a7cd8253618111 10:29:41 AM: deployId: 61f3b6ea96a7cd8253618113 10:29:41 AM: β 10:29:41 AM: β― Current directory 10:29:41 AM: /opt/build/repo 10:29:41 AM: β 10:29:41 AM: β― Config file 10:29:41 AM: No config file was defined: using default values. 10:29:41 AM: β 10:29:41 AM: β― Context 10:29:41 AM: production 10:29:41 AM: β 10:29:41 AM: β― Installing plugins 10:29:41 AM: - @netlify/plugin-nextjs@4.2.1 10:29:53 AM: β 10:29:53 AM: β― Loading plugins 10:29:53 AM: - @netlify/plugin-nextjs@4.2.1 from Netlify app 10:29:55 AM: β 10:29:55 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:55 AM: 1. @netlify/plugin-nextjs (onPreBuild event) 10:29:55 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:55 AM: β 10:29:55 AM: No Next.js cache to restore. 10:29:55 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed. 10:29:55 AM: β 10:29:55 AM: (@netlify/plugin-nextjs onPreBuild completed in 24ms) 10:29:55 AM: β 10:29:55 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:55 AM: 2. Build command from Netlify app 10:29:55 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:29:55 AM: β 10:29:55 AM: $ CI= npm run build 10:29:55 AM: > blion@1.0.0 build 10:29:55 AM: > next build 10:29:57 AM: info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5 10:29:57 AM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache 10:29:57 AM: info - Checking validity of types... 10:29:57 AM: info - Creating an optimized production build... 10:30:45 AM: warn - Compiled with warnings 10:30:45 AM: ./src/pages/404.js 10:30:45 AM: export 'getInitialProps' (reexported as 'getInitialProps') was not found in '../components/chakra' (possible exports: default, getServerSideProps) 10:30:45 AM: ./src/pages/404.js 10:30:45 AM: export 'getInitialProps' (reexported as 'getInitialProps') was not found in '../components/chakra' (possible exports: default, getServerSideProps) 10:30:45 AM: info - Collecting page data... 10:30:49 AM: Client warn: request fail { code: 'unauthorized', message: 'API token is invalid.' } 10:30:49 AM: > Build error occurred 10:30:49 AM: Error [APIResponseError]: API token is invalid. 10:30:49 AM: at Object.buildRequestError (/opt/build/repo/node_modules/@notionhq/client/build/src/errors.js:79:20) 10:30:49 AM: at Client.request (/opt/build/repo/node_modules/@notionhq/client/build/src/Client.js:206:43) 10:30:49 AM: at processTicksAndRejections (node:internal/process/task_queues:96:5) 10:30:49 AM: at async getPosts (/opt/build/repo/.next/server/chunks/493.js:23:20) 10:30:49 AM: at async getStaticPaths (/opt/build/repo/.next/server/pages/post/[slug].js:209:17) 10:30:49 AM: at async buildStaticPaths (/opt/build/repo/node_modules/next/dist/build/utils.js:472:31) 10:30:49 AM: at async /opt/build/repo/node_modules/next/dist/build/utils.js:615:119 10:30:49 AM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20) { 10:30:49 AM: type: 'APIResponseError', 10:30:49 AM: code: 'unauthorized', 10:30:49 AM: status: 401, 10:30:49 AM: headers: { 10:30:49 AM: date: 'Fri, 28 Jan 2022 09:30:49 GMT', 10:30:49 AM: 'content-type': 'application/json; charset=utf-8', 10:30:49 AM: 'content-length': '87', 10:30:49 AM: connection: 'close', 10:30:49 AM: 'set-cookie': [ 10:30:49 AM: 'notion_browser_id=4bf7c956-1853-4a17-baad-be13bd35dcb2; Domain=www.notion.so; Path=/; Expires=Sat, 28 Jan 2023 09:30:49 GMT; Secure', 10:30:49 AM: 'notion_experiment_device_id=b8c6c8b9-d6a8-4a77-9e50-2a748b43afc9; Domain=www.notion.so; Path=/; Expires=Sat, 28 Jan 2023 09:30:49 GMT; Secure', 10:30:49 AM: 'notion_check_cookie_consent=false; Domain=www.notion.so; Path=/; Expires=Sat, 29 Jan 2022 09:30:49 GMT; Secure' 10:30:49 AM: ], 10:30:49 AM: 'x-dns-prefetch-control': 'off', 10:30:49 AM: 'x-frame-options': 'SAMEORIGIN', 10:30:49 AM: 'strict-transport-security': 'max-age=5184000; includeSubDomains', 10:30:49 AM: 'x-download-options': 'noopen', 10:30:49 AM: 'x-content-type-options': 'nosniff', 10:30:49 AM: 'x-xss-protection': '1; mode=block', 10:30:49 AM: 'referrer-policy': 'same-origin', 10:30:49 AM: '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:", 10:30:49 AM: '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:", 10:30:49 AM: 'x-webkit-csp': "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:", 10:30:49 AM: etag: 'W/"57-QCRLT3IovYEW+CkwyJQlFtiXiG8"', 10:30:49 AM: vary: 'Accept-Encoding', 10:30:49 AM: 'cf-cache-status': 'DYNAMIC', 10:30:49 AM: 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 10:30:49 AM: server: 'cloudflare', 10:30:49 AM: 'cf-ray': '6d4934490f9d8133-ORD' 10:30:49 AM: }, 10:30:49 AM: body: '{"object":"error","status":401,"code":"unauthorized","message":"API token is invalid."}' 10:30:49 AM: } 10:30:49 AM: β 10:30:49 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:30:49 AM: "build.command" failed 10:30:49 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 10:30:49 AM: β 10:30:49 AM: Error message 10:30:49 AM: Command failed with exit code 1: CI= npm run build 10:30:49 AM: β 10:30:49 AM: Error location 10:30:49 AM: In Build command from Netlify app: 10:30:49 AM: CI= npm run build 10:30:49 AM: β 10:30:49 AM: Resolved config 10:30:49 AM: build: 10:30:49 AM: command: CI= npm run build 10:30:49 AM: commandOrigin: ui 10:30:49 AM: environment: 10:30:49 AM: - NEXT_PRIVATE_TARGET 10:30:49 AM: publish: /opt/build/repo/.next 10:30:49 AM: publishOrigin: ui 10:30:49 AM: plugins: 10:30:49 AM: - inputs: {} 10:30:49 AM: origin: ui 10:30:49 AM: package: '@netlify/plugin-nextjs' 10:30:49 AM: Caching artifacts 10:30:49 AM: Started saving node modules 10:30:49 AM: Finished saving node modules 10:30:49 AM: Started saving build plugins 10:30:49 AM: Finished saving build plugins 10:30:49 AM: Started saving yarn cache 10:30:53 AM: Finished saving yarn cache 10:30:53 AM: Started saving pip cache 10:30:53 AM: Finished saving pip cache 10:30:53 AM: Started saving emacs cask dependencies 10:30:53 AM: Finished saving emacs cask dependencies 10:30:53 AM: Started saving maven dependencies 10:30:53 AM: Finished saving maven dependencies 10:30:53 AM: Started saving boot dependencies 10:30:53 AM: Finished saving boot dependencies 10:30:53 AM: Started saving rust rustup cache 10:30:53 AM: Finished saving rust rustup cache 10:30:53 AM: Started saving go dependencies 10:30:53 AM: Finished saving go dependencies 10:30:55 AM: Build failed due to a user error: Build script returned non-zero exit code: 2 10:30:55 AM: Creating deploy upload records 10:30:56 AM: Failing build: Failed to build site 10:30:56 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 10:30:56 AM: Finished processing build request in 1m57.281946148s
Thanks for your answer ! The problem was effectively with the API. I changed everything, and it worked. But I donβt really understand why it worked loaly ahah