PLEASE help us help you by writing a good post!
we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
Build problems? Link or paste the FULL build log & build settings screenshot
The better the post - the faster the answer.
Site name: https://notes-universe.netlify.app
Github Repo: https://github.com/Liquefy7822/notes-universe
Background context. This is a project of mine. Wanted to build something for taking notes and stuff. Please ask if more information is needed.
Log:
12:32:34 PM: build-image version: 0143b4617dd9b5b3faed2aefa29c54a846e69aae (focal)
12:32:34 PM: buildbot version: 24f7c9fcfdc0e642a0e84524831960fde1f386d1
12:32:34 PM: Building without cache
12:32:34 PM: Starting to prepare the repo for build
12:32:35 PM: No cached dependencies found. Cloning fresh repo
12:32:35 PM: git clone --filter=blob:none git@github.com:Liquefy7822/notes-universe
12:32:35 PM: Preparing Git Reference refs/heads/main
12:32:37 PM: Starting to install dependencies
12:32:37 PM: Python version set to 3.8
12:32:37 PM: Attempting Ruby version 2.7.2, read from environment
12:32:38 PM: Using Ruby version 2.7.2
12:32:39 PM: Started restoring cached go cache
12:32:39 PM: Finished restoring cached go cache
12:32:40 PM: go version go1.19.13 linux/amd64
12:32:40 PM: Using PHP version 8.0
12:32:41 PM: v18.18.0 is already installed.
12:32:42 PM: Now using node v18.18.0 (npm v9.8.1)
12:32:42 PM: Enabling Node.js Corepack
12:32:42 PM: Started restoring cached build plugins
12:32:42 PM: Finished restoring cached build plugins
12:32:42 PM: Started restoring cached corepack dependencies
12:32:42 PM: Finished restoring cached corepack dependencies
12:32:42 PM: No npm workspaces detected
12:32:42 PM: Started restoring cached node modules
12:32:42 PM: Finished restoring cached node modules
12:32:42 PM: Installing npm packages using npm version 9.8.1
12:32:57 PM: added 194 packages, and audited 195 packages in 14s
12:32:57 PM: 39 packages are looking for funding
12:32:57 PM: run `npm fund` for details
12:32:57 PM: 4 moderate severity vulnerabilities
12:32:57 PM: To address all issues (including breaking changes), run:
12:32:57 PM: npm audit fix --force
12:32:57 PM: Run `npm audit` for details.
12:32:57 PM: npm packages installed
12:32:57 PM: Install dependencies script success
12:32:57 PM: Starting build script
12:32:58 PM: Detected 1 framework(s)
12:32:58 PM: "next" at version "12.3.4"
12:32:58 PM: Section completed: initializing
12:33:00 PM:
12:33:00 PM: Netlify Build
12:33:00 PM: ────────────────────────────────────────────────────────────────
12:33:00 PM:
12:33:00 PM: ❯ Version
12:33:00 PM: @netlify/build 29.21.1
12:33:00 PM:
12:33:00 PM: ❯ Flags
12:33:00 PM: baseRelDir: true
12:33:00 PM: buildId: 651ceae12135887d05ed9070
12:33:00 PM: deployId: 651ceae12135887d05ed9072
12:33:00 PM:
12:33:00 PM: ❯ Current directory
12:33:00 PM: /opt/build/repo
12:33:00 PM:
12:33:00 PM: ❯ Config file
12:33:00 PM: /opt/build/repo/netlify.toml
12:33:00 PM:
12:33:00 PM: ❯ Context
12:33:00 PM: production
12:33:00 PM:
12:33:00 PM: ❯ Installing plugins
12:33:00 PM: - @netlify/plugin-nextjs@4.40.1
12:33:00 PM: - netlify-plugin-cypress@2.2.0
12:33:17 PM:
12:33:17 PM: ❯ Using Next.js Runtime - v4.40.1
12:33:17 PM:
12:33:17 PM: ❯ Loading plugins
12:33:17 PM: - netlify-plugin-cypress@2.2.0 from netlify.toml
12:33:19 PM:
12:33:19 PM: @netlify/plugin-nextjs (onPreBuild event)
12:33:19 PM: ────────────────────────────────────────────────────────────────
12:33:19 PM:
12:33:19 PM: No Next.js cache to restore.
12:33:19 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
12:33:19 PM:
12:33:19 PM: (@netlify/plugin-nextjs onPreBuild completed in 48ms)
12:33:19 PM:
12:33:19 PM: netlify-plugin-cypress (onPreBuild event)
12:33:19 PM: ────────────────────────────────────────────────────────────────
12:33:19 PM:
12:33:27 PM: [STARTED] Task without title.
12:33:28 PM: [SUCCESS] Task without title.
12:33:29 PM: [4725:1004/043329.954826:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
12:33:30 PM: Displaying Cypress info...
12:33:30 PM: Detected no known browsers installed
12:33:30 PM: Proxy Settings: none detected
12:33:30 PM: Environment Variables:
12:33:30 PM: CYPRESS_CACHE_FOLDER: ./node_modules/.cache/CypressBinary
12:33:30 PM: Application Data: /opt/buildhome/.config/cypress/cy/development
12:33:30 PM: Browser Profiles: /opt/buildhome/.config/cypress/cy/development/browsers
12:33:30 PM: Binary Caches: /opt/build/repo/node_modules/.cache/CypressBinary
12:33:30 PM: Cypress Version: 10.11.0 (stable)
12:33:30 PM: System Platform: linux (Ubuntu - 20.04)
12:33:30 PM: System Memory: 66.3 GB free 54.8 GB
12:33:30 PM:
12:33:30 PM: (netlify-plugin-cypress onPreBuild completed in 10.9s)
12:33:30 PM:
12:33:30 PM: build.command from netlify.toml
12:33:30 PM: ────────────────────────────────────────────────────────────────
12:33:30 PM:
12:33:30 PM: $ npm run build
12:33:30 PM: > next-netlify-starter@0.5.0 build
12:33:30 PM: > next build
12:33:30 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:33:30 PM: info - Linting and checking validity of types...
12:33:31 PM: info - Creating an optimized production build...
12:33:36 PM: info - Compiled successfully
12:33:36 PM: info - Collecting page data...
12:33:38 PM: > Build optimization failed: found pages without a React Component as default export in
12:33:38 PM: pages/Viewnotes
12:33:38 PM: pages/Settings
12:33:38 PM: pages/Sharenote
12:33:38 PM: pages/Createnote
12:33:38 PM: See https://nextjs.org/docs/messages/page-without-valid-component for more info.
12:33:38 PM:
12:33:38 PM: "build.command" failed
12:33:38 PM: ────────────────────────────────────────────────────────────────
12:33:38 PM:
12:33:38 PM: Error message
12:33:38 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
12:33:38 PM:
12:33:38 PM: Error location
12:33:38 PM: In build.command from netlify.toml:
12:33:38 PM: npm run build
12:33:38 PM:
12:33:38 PM: Resolved config
12:33:38 PM: build:
12:33:38 PM: command: npm run build
12:33:38 PM: commandOrigin: config
12:33:38 PM: environment:
12:33:38 PM: - NEXT_PRIVATE_TARGET
12:33:38 PM: publish: /opt/build/repo/.next
12:33:38 PM: publishOrigin: config
12:33:38 PM: plugins:
12:33:38 PM: - inputs: {}
12:33:38 PM: origin: ui
12:33:38 PM: package: "@netlify/plugin-nextjs"
12:33:38 PM: - inputs: {}
12:33:38 PM: origin: config
12:33:38 PM: package: netlify-plugin-cypress
12:33:39 PM: Caching artifacts
12:33:39 PM: Started saving node modules
12:33:39 PM: Finished saving node modules
12:33:39 PM: Started saving build plugins
12:33:39 PM: Finished saving build plugins
12:33:39 PM: Started saving corepack cache
12:33:39 PM: Finished saving corepack cache
12:33:39 PM: Started saving pip cache
12:33:39 PM: Finished saving pip cache
12:33:39 PM: Started saving emacs cask dependencies
12:33:39 PM: Finished saving emacs cask dependencies
12:33:39 PM: Started saving maven dependencies
12:33:39 PM: Finished saving maven dependencies
12:33:39 PM: Started saving boot dependencies
12:33:39 PM: Finished saving boot dependencies
12:33:39 PM: Started saving rust rustup cache
12:33:39 PM: Finished saving rust rustup cache
12:33:39 PM: Started saving go dependencies
12:33:39 PM: Finished saving go dependencies
12:33:40 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
12:33:40 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:33:40 PM: Failing build: Failed to build site
12:33:40 PM: Finished processing build request in 1m6.065s
Melvin
October 4, 2023, 9:54am
2
Hi @EmmanuelYee ,
Thanks for reaching out and welcome to Netlify’s Support Forums!
The problem appears to be these lines from the deploy log :
11:33:38 PM: > Build optimization failed: found pages without a React Component as default export in
11:33:38 PM: pages/Viewnotes
11:33:38 PM: pages/Settings
11:33:38 PM: pages/Sharenote
11:33:38 PM: pages/Createnote
11:33:38 PM: See https://nextjs.org/docs/messages/page-without-valid-component for more info.
You’ll want to investigate that error. The provided link has some good troubleshooting information!
Hope this helps!
Oh thanks!
I think i found the problem, but I hope you don’t mind checking with me.
I left the whole code blank. So I made a setting.js, but there is nothing in there. is that the problem?
Melvin
October 5, 2023, 4:19pm
4
Hi @EmmanuelYee ,
Thanks for the follow-up. I apologize, I’m not sure what you mean when you state that you left the whole code blank.
From the Next.js docs mentioned: Page Without Valid React Component | Next.js
I believe those files (Viewnotes, Settings, Sharenote, and Createnote) need to be taken out of the pages
folder. However, that doc has a list of possible fixes here that you’ll want to go through to resolve that error message.
I tried deleting all the above pages but still get errors.
11:50:27 AM: build-image version: 0143b4617dd9b5b3faed2aefa29c54a846e69aae (focal)
11:50:27 AM: buildbot version: 24f7c9fcfdc0e642a0e84524831960fde1f386d1
11:50:28 AM: Fetching cached dependencies
11:50:28 AM: Starting to download cache of 397.0MB
11:50:35 AM: Finished downloading cache in 7.335s
11:50:35 AM: Starting to extract cache
11:50:39 AM: Finished extracting cache in 3.855s
11:50:39 AM: Finished fetching cache in 11.265s
11:50:39 AM: Starting to prepare the repo for build
11:50:39 AM: Preparing Git Reference refs/heads/main
11:50:42 AM: Starting to install dependencies
11:50:42 AM: Python version set to 3.8
11:50:42 AM: Attempting Ruby version 2.7.2, read from environment
11:50:42 AM: Using Ruby version 2.7.2
11:50:43 AM: Started restoring cached go cache
11:50:43 AM: Finished restoring cached go cache
11:50:44 AM: go version go1.19.13 linux/amd64
11:50:44 AM: Using PHP version 8.0
11:50:45 AM: Started restoring cached Node.js version
11:50:46 AM: Finished restoring cached Node.js version
11:50:46 AM: v18.18.0 is already installed.
11:50:46 AM: Now using node v18.18.0 (npm v9.8.1)
11:50:46 AM: Enabling Node.js Corepack
11:50:46 AM: Started restoring cached build plugins
11:50:46 AM: Finished restoring cached build plugins
11:50:46 AM: Started restoring cached corepack dependencies
11:50:46 AM: Finished restoring cached corepack dependencies
11:50:46 AM: No npm workspaces detected
11:50:46 AM: Started restoring cached node modules
11:50:46 AM: Finished restoring cached node modules
11:50:47 AM: Installing npm packages using npm version 9.8.1
11:50:48 AM: up to date, audited 195 packages in 945ms
11:50:48 AM: 39 packages are looking for funding
11:50:48 AM: run `npm fund` for details
11:50:48 AM: 4 moderate severity vulnerabilities
11:50:48 AM: To address all issues (including breaking changes), run:
11:50:48 AM: npm audit fix --force
11:50:48 AM: Run `npm audit` for details.
11:50:48 AM: npm packages installed
11:50:48 AM: Install dependencies script success
11:50:48 AM: Starting build script
11:50:49 AM: Detected 1 framework(s)
11:50:49 AM: "next" at version "12.3.4"
11:50:49 AM: Section completed: initializing
11:50:51 AM:
11:50:51 AM: Netlify Build
11:50:51 AM: ────────────────────────────────────────────────────────────────
11:50:51 AM:
11:50:51 AM: ❯ Version
11:50:51 AM: @netlify/build 29.21.1
11:50:51 AM:
11:50:51 AM: ❯ Flags
11:50:51 AM: baseRelDir: true
11:50:51 AM: buildId: 65237881e5e5c90009e5e727
11:50:51 AM: deployId: 65237881e5e5c90009e5e729
11:50:51 AM:
11:50:51 AM: ❯ Current directory
11:50:51 AM: /opt/build/repo
11:50:51 AM:
11:50:51 AM: ❯ Config file
11:50:51 AM: /opt/build/repo/netlify.toml
11:50:51 AM:
11:50:51 AM: ❯ Context
11:50:51 AM: production
11:50:51 AM:
11:50:51 AM: ❯ Installing plugins
11:50:51 AM: - @netlify/plugin-nextjs@4.40.2
11:50:53 AM:
11:50:53 AM: ❯ Using Next.js Runtime - v4.40.2
11:50:53 AM:
11:50:53 AM: ❯ Loading plugins
11:50:53 AM: - netlify-plugin-cypress@2.2.0 from netlify.toml
11:50:54 AM:
11:50:54 AM: @netlify/plugin-nextjs (onPreBuild event)
11:50:54 AM: ────────────────────────────────────────────────────────────────
11:50:54 AM:
11:50:54 AM: Next.js cache restored.
11:50:54 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
11:50:54 AM:
11:50:54 AM: (@netlify/plugin-nextjs onPreBuild completed in 98ms)
11:50:54 AM:
11:50:54 AM: netlify-plugin-cypress (onPreBuild event)
11:50:54 AM: ────────────────────────────────────────────────────────────────
11:50:54 AM:
11:50:54 AM: [STARTED] Task without title.
11:50:56 AM: [SUCCESS] Task without title.
11:50:57 AM: [4326:1009/035057.776513:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
11:50:57 AM: Displaying Cypress info...
11:50:57 AM: Detected no known browsers installed
11:50:57 AM: Proxy Settings: none detected
11:50:57 AM: Environment Variables:
11:50:57 AM: CYPRESS_CACHE_FOLDER: ./node_modules/.cache/CypressBinary
11:50:57 AM: Application Data: /opt/buildhome/.config/cypress/cy/development
11:50:57 AM: Browser Profiles: /opt/buildhome/.config/cypress/cy/development/browsers
11:50:57 AM: Binary Caches: /opt/build/repo/node_modules/.cache/CypressBinary
11:50:57 AM: Cypress Version: 10.11.0 (stable)
11:50:57 AM: System Platform: linux (Ubuntu - 20.04)
11:50:57 AM: System Memory: 66.3 GB free 57.5 GB
11:50:57 AM:
11:50:57 AM: (netlify-plugin-cypress onPreBuild completed in 3.6s)
11:50:57 AM:
11:50:57 AM: build.command from netlify.toml
11:50:57 AM: ────────────────────────────────────────────────────────────────
11:50:57 AM:
11:50:57 AM: $ npm run build
11:50:58 AM: > next-netlify-starter@0.5.0 build
11:50:58 AM: > next build
11:50:58 AM: info - Linting and checking validity of types...
11:50:59 AM: info - Creating an optimized production build...
11:51:00 AM: warn - Found lockfile missing swc dependencies, run next locally to automatically patch
11:51:02 AM: info - Compiled successfully
11:51:02 AM: info - Collecting page data...
11:51:03 AM: info - Generating static pages (0/6)
11:51:03 AM: info - Generating static pages (1/6)
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: Error occurred prerendering page "/signup". Read more: https://nextjs.org/docs/messages/prerender-error
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: info - Generating static pages (2/6)
11:51:03 AM: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: info - Generating static pages (4/6)
11:51:03 AM: Error occurred prerendering page "/profile". Read more: https://nextjs.org/docs/messages/prerender-error
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: Error occurred prerendering page "/login". Read more: https://nextjs.org/docs/messages/prerender-error
11:51:03 AM: ReferenceError: Head is not defined
11:51:03 AM: at Layout (/opt/build/repo/.next/server/chunks/789.js:47:94)
11:51:03 AM: at Wc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: at Zc (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
11:51:03 AM: at Z (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
11:51:03 AM: info - Generating static pages (6/6)
11:51:03 AM: > Build error occurred
11:51:03 AM: Error: Export encountered errors on following paths:
11:51:03 AM: /
11:51:03 AM: /login
11:51:03 AM: /profile
11:51:03 AM: /signup
11:51:03 AM: at /opt/build/repo/node_modules/next/dist/export/index.js:404:19
11:51:03 AM: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
11:51:03 AM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:79:20)
11:51:03 AM: at async /opt/build/repo/node_modules/next/dist/build/index.js:1230:21
11:51:03 AM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:79:20)
11:51:03 AM: at async /opt/build/repo/node_modules/next/dist/build/index.js:1092:17
11:51:03 AM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:79:20)
11:51:03 AM: at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:65:29)
11:51:04 AM:
11:51:04 AM: "build.command" failed
11:51:04 AM: ────────────────────────────────────────────────────────────────
11:51:04 AM:
11:51:04 AM: Error message
11:51:04 AM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
11:51:04 AM:
11:51:04 AM: Error location
11:51:04 AM: In build.command from netlify.toml:
11:51:04 AM: npm run build
11:51:04 AM:
11:51:04 AM: Resolved config
11:51:04 AM: build:
11:51:04 AM: command: npm run build
11:51:04 AM: commandOrigin: config
11:51:04 AM: environment:
11:51:04 AM: - NEXT_PRIVATE_TARGET
11:51:04 AM: publish: /opt/build/repo/.next
11:51:04 AM: publishOrigin: config
11:51:04 AM: plugins:
11:51:04 AM: - inputs: {}
11:51:04 AM: origin: ui
11:51:04 AM: package: "@netlify/plugin-nextjs"
11:51:04 AM: - inputs: {}
11:51:04 AM: origin: config
11:51:04 AM: package: netlify-plugin-cypress
11:51:05 AM: Caching artifacts
11:51:05 AM: Started saving node modules
11:51:05 AM: Finished saving node modules
11:51:05 AM: Started saving build plugins
11:51:05 AM: Finished saving build plugins
11:51:05 AM: Started saving corepack cache
11:51:05 AM: Finished saving corepack cache
11:51:05 AM: Started saving pip cache
11:51:05 AM: Finished saving pip cache
11:51:05 AM: Started saving emacs cask dependencies
11:51:05 AM: Finished saving emacs cask dependencies
11:51:05 AM: Started saving maven dependencies
11:51:05 AM: Finished saving maven dependencies
11:51:05 AM: Started saving boot dependencies
11:51:05 AM: Finished saving boot dependencies
11:51:05 AM: Started saving rust rustup cache
11:51:05 AM: Finished saving rust rustup cache
11:51:05 AM: Started saving go dependencies
11:51:05 AM: Finished saving go dependencies
11:51:05 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:51:05 AM: Failing build: Failed to build site
11:51:05 AM: Finished processing build request in 37.58s
11:51:05 AM: Failed during stage "building site": Build script returned non-zero exit code: 2
This is clearly an error with your code and not something we can help with. Please try building your code locally (preferably on Ubuntu machines).