Hello, there is an issue when I try to deploy my repository. For environmental variables I have CI = true. I’m using yarn to install the modules and there is a yarn.lock. My next config only contains reactStrictMode: true.
Build:
6:34:16 PM: $ yarn build
6:34:16 PM: yarn run v1.22.10
6:34:16 PM: $ next build
6:34:17 PM: info - Using webpack 5. Reason: Enabled by default webpack5 | Next.js
6:34:18 PM: info - Checking validity of types…
6:34:21 PM: info - Creating an optimized production build…
6:34:56 PM: (node:1481) [DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API
6:34:59 PM: Failed to compile.
6:34:59 PM:
6:34:59 PM: ./node_modules/esbuild/lib/main.d.ts
6:34:59 PM: Module parse failed: Unexpected token (1:7)
6:34:59 PM: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See Concepts | webpack
6:34:59 PM: > export type Platform = ‘browser’ | ‘node’ | ‘neutral’;
6:34:59 PM: | export type Format = ‘iife’ | ‘cjs’ | ‘esm’;
6:34:59 PM: | export type Loader = ‘js’ | ‘jsx’ | ‘ts’ | ‘tsx’ | ‘css’ | ‘json’ | ‘text’ | ‘base64’ | ‘file’ | ‘dataurl’ | ‘binary’ | ‘default’;
6:34:59 PM: > Build error occurred
6:34:59 PM: Error: > Build failed because of webpack errors
6:34:59 PM: at /opt/build/repo/node_modules/next/dist/build/index.js:397:19
6:34:59 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
6:34:59 PM: at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:77:25)
6:34:59 PM: error Command failed with exit code 1.
6:34:59 PM: info Visit yarn run | Yarn for documentation about this command.
6:34:59 PM:
6:34:59 PM: ────────────────────────────────────────────────────────────────
6:34:59 PM: “build.command” failed
6:34:59 PM: ────────────────────────────────────────────────────────────────
6:34:59 PM:
6:34:59 PM: Error message
6:34:59 PM: Command failed with exit code 1: yarn build
6:34:59 PM:
6:34:59 PM: Error location
6:34:59 PM: In Build command from Netlify app:
6:34:59 PM: yarn build
6:34:59 PM:
6:34:59 PM: Resolved config
6:34:59 PM: build:
6:34:59 PM: command: yarn build
6:34:59 PM: commandOrigin: ui
6:34:59 PM: environment:
6:34:59 PM: - CI
6:34:59 PM: publish: /opt/build/repo/build
6:34:59 PM: publishOrigin: ui
6:34:59 PM: plugins:
6:34:59 PM: - inputs: {}
6:34:59 PM: origin: ui
6:34:59 PM: package: ‘@netlify/plugin-nextjs’
6:35:00 PM: Caching artifacts
6:35:00 PM: Started saving node modules
6:35:00 PM: Finished saving node modules
6:35:00 PM: Started saving build plugins
6:35:00 PM: Finished saving build plugins
6:35:00 PM: Started saving yarn cache
6:35:10 PM: Finished saving yarn cache
6:35:10 PM: Started saving pip cache
6:35:10 PM: Finished saving pip cache
6:35:10 PM: Started saving emacs cask dependencies
6:35:10 PM: Finished saving emacs cask dependencies
6:35:10 PM: Started saving maven dependencies
6:35:10 PM: Finished saving maven dependencies
6:35:10 PM: Started saving boot dependencies
6:35:10 PM: Finished saving boot dependencies
6:35:10 PM: Started saving rust rustup cache
6:35:10 PM: Finished saving rust rustup cache
6:35:10 PM: Started saving go dependencies
6:35:10 PM: Finished saving go dependencies
6:35:10 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:35:10 PM: Creating deploy upload records
6:35:10 PM: Failing build: Failed to build site
6:35:10 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
6:35:10 PM: Finished processing build request in 1m56.71382048s