Build on netlify returns error, while on local passes

vinciso.netlify.app

While building the code on netlify the following error ocurs

11:53:53 AM: $ next build
11:53:53 AM: warn  - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled
11:53:53 AM: info  - Checking validity of types...
11:54:13 AM: ./src/components/ui/navbar/navbar.tsx
11:54:13 AM: 35:21  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
11:54:13 AM: 44:33  Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
11:54:13 AM: ./src/components/ui/navbar/navigation-links.js
11:54:13 AM: 14:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
11:54:13 AM: 17:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
11:54:13 AM: 20:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
11:54:13 AM: 25:13  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
11:54:13 AM: ./src/components/ui/team/member-details.js
11:54:13 AM: 9:9  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
11:54:13 AM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
11:54:13 AM: info  - Creating an optimized production build...
11:54:43 AM: info  - Compiled successfully
11:54:43 AM: info  - Collecting page data...
11:54:46 AM: TypeError: Only absolute URLs are supported
11:54:46 AM:     at getNodeRequestOptions (/opt/build/repo/node_modules/node-fetch/lib/index.js:1327:9)
11:54:46 AM:     at /opt/build/repo/node_modules/node-fetch/lib/index.js:1440:19
11:54:46 AM:     at new Promise (<anonymous>)
11:54:46 AM:     at fetch (/opt/build/repo/node_modules/node-fetch/lib/index.js:1437:9)
11:54:46 AM:     at fetch_sitemap (/opt/build/repo/node_modules/sitemap-links/index.js:10:3)
11:54:46 AM:     at get_sitemap_links (/opt/build/repo/node_modules/sitemap-links/index.js:47:23)
11:54:46 AM:     at getStaticPaths (/opt/build/repo/.next/server/pages/[...path].js:37:57)
11:54:46 AM:     at buildStaticPaths (/opt/build/repo/node_modules/next/dist/build/utils.js:497:37)
11:54:46 AM:     at /opt/build/repo/node_modules/next/dist/build/utils.js:640:125
11:54:46 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
11:54:46 AM: Error: Unable to fetch sitemap.
11:54:46 AM:     at get_sitemap_links (/opt/build/repo/node_modules/sitemap-links/index.js:56:11)
11:54:46 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
11:54:46 AM:     at async getStaticPaths (/opt/build/repo/.next/server/pages/[...path].js:37:19)
11:54:46 AM:     at async buildStaticPaths (/opt/build/repo/node_modules/next/dist/build/utils.js:497:31)
11:54:46 AM:     at async /opt/build/repo/node_modules/next/dist/build/utils.js:640:119
11:54:46 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20)
11:54:46 AM: > Build error occurred
11:54:46 AM: TypeError: links is not iterable
11:54:46 AM:     at getStaticPaths (/opt/build/repo/.next/server/pages/[...path].js:42:22)
11:54:46 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
11:54:46 AM:     at async buildStaticPaths (/opt/build/repo/node_modules/next/dist/build/utils.js:497:31)
11:54:46 AM:     at async /opt/build/repo/node_modules/next/dist/build/utils.js:640:119
11:54:46 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) {
11:54:46 AM:   type: 'TypeError'
11:54:46 AM: }
11:54:46 AM: error Command failed with exit code 1.
11:54:46 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
11:54:46 AM: ​
11:54:46 AM: ────────────────────────────────────────────────────────────────
11:54:46 AM:   "build.command" failed                                        
11:54:46 AM: ────────────────────────────────────────────────────────────────
11:54:46 AM: ​
11:54:46 AM:   Error message
11:54:46 AM:   Command failed with exit code 1: yarn run build
11:54:46 AM: ​
11:54:46 AM:   Error location
11:54:46 AM:   In Build command from Netlify app:
11:54:46 AM:   yarn run build
11:54:46 AM: ​
11:54:46 AM:   Resolved config
11:54:46 AM:   build:
11:54:46 AM:     command: yarn run build
11:54:46 AM:     commandOrigin: ui
11:54:46 AM:     environment:
11:54:46 AM:       - NEXT_PRIVATE_TARGET
11:54:46 AM:     publish: /opt/build/repo/.next
11:54:46 AM:     publishOrigin: ui
11:54:46 AM:   plugins:
11:54:46 AM:     - inputs: {}
11:54:46 AM:       origin: ui
11:54:46 AM:       package: '@netlify/plugin-nextjs'
11:54:46 AM: Caching artifacts
11:54:46 AM: Started saving node modules
11:54:46 AM: Finished saving node modules
11:54:46 AM: Started saving build plugins
11:54:46 AM: Finished saving build plugins
11:54:46 AM: Started saving pip cache
11:54:47 AM: Finished saving pip cache
11:54:47 AM: Started saving emacs cask dependencies
11:54:47 AM: Finished saving emacs cask dependencies
11:54:47 AM: Started saving maven dependencies
11:54:47 AM: Finished saving maven dependencies
11:54:47 AM: Started saving boot dependencies
11:54:47 AM: Finished saving boot dependencies
11:54:47 AM: Started saving rust rustup cache
11:54:47 AM: Finished saving rust rustup cache
11:54:47 AM: Started saving go dependencies
11:54:47 AM: Finished saving go dependencies
11:54:49 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:54:49 AM: Creating deploy upload records
11:54:49 AM: Failing build: Failed to build site
11:54:50 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:54:50 AM: Finished processing build request in 1m51.759957864s

While on the local machine running the same command fully works

> next build

warn  - You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env
info  - Loaded env from /home/jota/repos/the-parzival-mvp/.env.local
warn  - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled
info  - Checking validity of types  

./src/components/ui/navbar/navbar.tsx
35:21  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
44:33  Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text

./src/components/ui/navbar/navigation-links.js
14:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
17:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
20:9  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref
25:13  Warning: passHref is missing. See https://nextjs.org/docs/messages/link-passhref  @next/next/link-passhref

./src/components/ui/team/member-details.js
9:9  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data  
[  ==] info  - Generating static pages (5/6)Component Button was not imported, exported, or provided by MDXProvider as global scope
info  - Generating static pages (6/6)
info  - Finalizing page optimization  

Page                                               Size     First Load JS
┌ ○ / (820 ms)                                     179 B           148 kB
├   /_app                                          0 B             142 kB
├ ● /[...path]                                     252 B           148 kB
├ ○ /404                                           180 B           142 kB
├ ○ /about                                         1.45 kB         144 kB
├ λ /api/auth/[...nextauth]                        0 B             142 kB
├ λ /api/db                                        0 B             142 kB
├ λ /api/dbAPI/dbGetPostData                       0 B             142 kB
├ λ /api/dbAPI/dbSavePostData                      0 B             142 kB
├ λ /api/dbAPI/dbSaveUserWalletAPI                 0 B             142 kB
├ ● /projects (977 ms)                             2.41 kB         145 kB
└ ● /projects/[slug] (4991 ms)                     295 kB          437 kB
    └ /projects/functions-for-beginners (4991 ms)
+ First Load JS shared by all                      142 kB
  ├ chunks/framework-740585cc2af47890.js           42.1 kB
  ├ chunks/main-b3249eec7e7c1f81.js                27.1 kB
  ├ chunks/pages/_app-451e8f1beae7b041.js          72.2 kB
  ├ chunks/webpack-0eba907a80a39402.js             868 B
  └ css/7b7b959f811f21e6.css                       1.25 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

Hey @joao.theparzival,

It appears to me that you’re using relative URLs in code server-side code. Since the server cannot resolve relative URLs, you probably need to convert your URLs to absolute.