Having a bit of trouble figuring out where my build is breaking. I am getting the build.command failure message, but can’t figure out where in the build I need to be looking. Can anyone point me to where the build might be failing so I can take a look at my code? Here’s the error log:
9:48:14 PM: ────────────────────────────────────────────────────────────────
9:48:14 PM: Netlify Build
9:48:14 PM: ────────────────────────────────────────────────────────────────
9:48:14 PM:
9:48:14 PM: ❯ Version
9:48:14 PM: @netlify/build 29.1.1
9:48:14 PM:
9:48:14 PM: ❯ Flags
9:48:14 PM: baseRelDir: true
9:48:14 PM: buildId: 639bdc50d6dceb0008b56354
9:48:14 PM: deployId: 639bdc50d6dceb0008b56356
9:48:14 PM:
9:48:14 PM: ❯ Current directory
9:48:14 PM: /opt/build/repo
9:48:14 PM:
9:48:14 PM: ❯ Config file
9:48:14 PM: /opt/build/repo/netlify.toml
9:48:14 PM:
9:48:14 PM: ❯ Context
9:48:14 PM: production
9:48:14 PM:
9:48:14 PM: ❯ Using Next.js Runtime - v4.29.3
9:48:16 PM:
9:48:16 PM: ────────────────────────────────────────────────────────────────
9:48:16 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
9:48:16 PM: ────────────────────────────────────────────────────────────────
9:48:16 PM:
9:48:16 PM: No Next.js cache to restore.
9:48:16 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
9:48:16 PM:
9:48:16 PM: (@netlify/plugin-nextjs onPreBuild completed in 24ms)
9:48:16 PM:
9:48:16 PM: ────────────────────────────────────────────────────────────────
9:48:16 PM: 2. build.command from netlify.toml
9:48:16 PM: ────────────────────────────────────────────────────────────────
9:48:16 PM:
9:48:16 PM: $ npm run build
9:48:16 PM: > levelupspanish_v1.0@1.0.0 build
9:48:16 PM: > next build
9:48:16 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
9:48:17 PM: info - Linting and checking validity of types...
9:48:20 PM:
9:48:20 PM: Failed to compile.
9:48:20 PM: ./pages/api/admin-lesson/get-lessons.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/admin-lesson/publish-lesson.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/admin-lesson/save-lesson.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/delete-account/index.js
9:48:20 PM: 13:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/flashphrase/create-card.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/flashphrase/create-deck.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/flashphrase/edit-card.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/flashphrase/edit-deck.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/flashphrase/get-phrases.js
9:48:20 PM: 8:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/lesson/get-lesson.js
9:48:20 PM: 9:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/lesson/purchase-lesson.js
9:48:20 PM: 9:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/login/index.js
9:48:20 PM: 10:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/recover-password/send-email.js
9:48:20 PM: 10:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/recover-password/update-password.js
9:48:20 PM: 9:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/refresh-token/index.js
9:48:20 PM: 9:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/register/index.js
9:48:20 PM: 14:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/unsubscribe/index.js
9:48:20 PM: 12:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/update-user/give-experience.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/update-user/update-info.js
9:48:20 PM: 12:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/update-user/update-password.js
9:48:20 PM: 10:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/user-lesson/daily-lesson.js
9:48:20 PM: 10:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/user-lesson/lesson-archives.js
9:48:20 PM: 9:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/api/user-lesson/user-unlocked-lesson.js
9:48:20 PM: 7:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export
9:48:20 PM: ./pages/scramble.js
9:48:20 PM: 39:6 Warning: React Hook useEffect has a missing dependency: 'getWords'. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: ./components/auth/ForgotPassword.js
9:48:20 PM: 22:6 Warning: React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: 110:44 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: 177:53 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: ./components/auth/Register.js
9:48:20 PM: 148:15 Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 155:15 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 155:15 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/createlesson/CreateLesson.js
9:48:20 PM: 127:6 Warning: React Hook useEffect has missing dependencies: 'props.auth.isAuthenticated', 'props.auth.loading', and 'router'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: 1001:34 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1001:34 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1002:51 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:22 PM: Creating deploy upload records
9:48:20 PM: 1002:51 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1126:34 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1126:34 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1127:51 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:23 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:48:20 PM: 1127:51 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1250:34 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1250:34 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1251:51 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1251:51 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1375:34 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1375:34 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 1376:51 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 1376:51 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/flashphrase/EditDeck.js
9:48:20 PM: 80:6 Warning: React Hook useEffect has missing dependencies: 'props.deck.description', 'props.deck.flashPhrases', 'props.deck.title', and 'props.phrases'. Either include them or remove the dependency array. If 'setTitle' needs the current value of 'props.deck.title', you can also switch to useReducer instead of useState and read 'props.deck.title' in the reducer. react-hooks/exhaustive-deps
9:48:20 PM: ./components/functions/SpeechToText.js
9:48:20 PM: 68:89 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: 68:206 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: ./components/image/WebImage.js
9:48:20 PM: 5:5 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/layout/Navbar.js
9:48:20 PM: 36:19 Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 50:19 Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 69:19 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/lesson/Lesson.js
9:48:20 PM: 122:6 Warning: React Hook useEffect has missing dependencies: 'props.auth.isAuthenticated', 'props.auth.loading', 'props.lesson', and 'router'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: 219:13 Error: Missing "key" prop for element in iterator react/jsx-key
9:48:20 PM: 288:28 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 288:28 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 289:29 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 289:29 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 290:29 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 290:29 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 291:30 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 291:30 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/lesson/functions/Speech.js
9:48:20 PM: 172:49 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: 172:135 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: ./components/lessons/Lessons.js
9:48:20 PM: 52:6 Warning: React Hook useEffect has missing dependencies: 'lessons', 'props.auth.isAuthenticated', 'props.auth.loading', and 'router'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: ./components/payments/CheckoutForm.js
9:48:20 PM: 43:6 Warning: React Hook useEffect has a missing dependency: 'props.clientSecret'. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: ./components/payments/PurchaseForm.js
9:48:20 PM: 27:6 Warning: React Hook useEffect has a missing dependency: 'props.amount'. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: ./components/profile/Profile.js
9:48:20 PM: 18:9 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: ./components/quiz/Quiz.js
9:48:20 PM: 158:17 Error: `"` can be escaped with `"`, `“`, `"`, `”`. react/no-unescaped-entities
9:48:20 PM: 158:113 Error: `"` can be escaped with `"`, `“`, `"`, `”`. react/no-unescaped-entities
9:48:20 PM: 173:155 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities
9:48:20 PM: ./components/scramble/Scramble.js
9:48:20 PM: 49:6 Warning: React Hook useEffect has missing dependencies: 'data.definitions', 'data.englishWord', 'data.spanishWord', and 'definitionInc'. Either include them or remove the dependency array. If 'setShuffledWord' needs the current value of 'data.spanishWord', you can also switch to useReducer instead of useState and read 'data.spanishWord' in the reducer. react-hooks/exhaustive-deps
9:48:20 PM: ./components/settings/UpdateInfo.js
9:48:20 PM: 67:6 Warning: React Hook useEffect has missing dependencies: 'props.auth.isAuthenticated', 'props.auth.loading', and 'router'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
9:48:20 PM: 262:13 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 262:13 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: 264:13 Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 271:15 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
9:48:20 PM: 271:15 Warning: Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
9:48:20 PM: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
9:48:20 PM:
9:48:20 PM: ────────────────────────────────────────────────────────────────
9:48:20 PM: "build.command" failed
9:48:20 PM: ────────────────────────────────────────────────────────────────
9:48:20 PM:
9:48:20 PM: Error message
9:48:20 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
9:48:20 PM:
9:48:20 PM: Error location
9:48:20 PM: In build.command from netlify.toml:
9:48:20 PM: npm run build
9:48:20 PM:
9:48:20 PM: Resolved config
9:48:20 PM: build:
9:48:20 PM: command: npm run build
9:48:20 PM: commandOrigin: config
9:48:20 PM: environment:
9:48:20 PM: publish: /opt/build/repo/.next
9:48:20 PM: publishOrigin: config
9:48:20 PM: plugins:
9:48:20 PM: - inputs: {}
9:48:20 PM: origin: config
9:48:20 PM: package: '@netlify/plugin-nextjs'
9:48:20 PM: Caching artifacts
9:48:20 PM: Started saving node modules
9:48:20 PM: Finished saving node modules
9:48:20 PM: Started saving build plugins
9:48:20 PM: Finished saving build plugins
9:48:20 PM: Started saving pip cache
9:48:20 PM: Finished saving pip cache
9:48:20 PM: Started saving emacs cask dependencies
9:48:21 PM: Finished saving emacs cask dependencies
9:48:21 PM: Started saving maven dependencies
9:48:21 PM: Finished saving maven dependencies
9:48:21 PM: Started saving boot dependencies
9:48:21 PM: Finished saving boot dependencies
9:48:21 PM: Started saving rust rustup cache
9:48:21 PM: Finished saving rust rustup cache
9:48:21 PM: Started saving go dependencies
9:48:21 PM: Finished saving go dependencies
9:48:22 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:48:23 PM: Failing build: Failed to build site
9:48:23 PM: Finished processing build request in 35.255218017s