I've been working on a local Next.js app, but encountered an error when deploying it.
Vercel Deployment Error: Command "npm run build" exited with 1
Here is the log from the build process:
[08:26:17.892] Cloning github.com/Bossman556/TechMoneyLlc (Branch: main, Commit: 1fdf14b)
[08:26:17.899] The cli flag --force was set. Skipping build cache download.
[08:26:20.729] Cloning completed: 2.837s
[08:26:21.188] Not using Build Cache
[08:26:21.242] Running "vercel build"
[08:26:21.887] Vercel CLI 28.4.14
[08:26:22.295] Detected `package-lock.json` generated by npm 7+...
[08:26:22.306] Installing dependencies...
[08:26:40.266] npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93f0fce1f6bef9e0d3a0bda5bda6">[email protected]</a>: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
[08:26:44.660]
[08:26:44.661] added 518 packages in 22s
[08:26:44.661]
[08:26:44.661] 95 packages are looking for funding
[08:26:44.661] run `npm fund` for details
[08:26:44.687] Detected Next.js version: 12.3.1
[08:26:44.694] Running "npm run build"
[08:26:45.093]
[08:26:45.094] > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9dacac8c4e99987988799">[email protected]</a> build
[08:26:45.094] > next build
[08:26:45.094]
[08:26:45.684] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[08:26:45.685] This information is used to shape Next.js' roadmap and prioritize features.
[08:26:45.685] 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:
[08:26:45.685] https://nextjs.org/telemetry
[08:26:45.685]
[08:26:45.831] info - Linting and checking validity of types...
[08:26:46.346] error - ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/.eslintrc.json
[08:26:49.527] info - Creating an optimized production build...
[08:26:49.891] info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
[08:26:50.658] info - Using external babel configuration from /vercel/path0/.babelrc
[08:27:08.485] info - Compiled successfully
[08:27:08.486] info - Collecting page data...
[08:27:12.880]
[08:27:12.880] > Build optimization failed: found page without a React Component as default export in
[08:27:12.880] pages/vidsForCourses/VideoPlayer
[08:27:12.881]
[08:27:12.881] See https://nextjs.org/docs/messages/page-without-valid-component for more info.
[08:27:12.881]
[08:27:12.942] Error: Command "npm run build" exited with 1
I attempted solutions such as setting the environment variable CI to false:
CI = false
I also tried:
In the "Build & Development Settings," override the Build command and write CI='' npm run build.
Additionally, I downgraded the node version but unfortunately that didn't resolve the issue.