'Failed to compile when deploying next.js website on netlify after adding webp images
I faced a problem that the deploying next.js website on netlify is failed after I added some webp images.
7:56:07 PM: Failed to compile.
7:56:07 PM:
7:56:07 PM: ./assets/images/categories/Charitytoken.webp
7:56:07 PM: Error: Buffer has an unsupported format
7:56:07 PM: > Build error occurred
7:56:07 PM: Error: > Build failed because of webpack errors
7:56:07 PM: at /opt/build/repo/node_modules/next/dist/build/index.js:397:19
7:56:07 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
7:56:07 PM: at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:77:25)
7:56:07 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
7:56:07 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
7:56:07 PM:
7:56:07 PM: ────────────────────────────────────────────────────────────────
7:56:07 PM: "build.command" failed
7:56:07 PM: ────────────────────────────────────────────────────────────────
7:56:07 PM:
7:56:07 PM: Error message
7:56:07 PM: Command failed with exit code 1: yarn build (https://ntl.fyi/exit-code-1)
7:56:07 PM:
7:56:07 PM: Error location
7:56:07 PM: In Build command from Netlify app:
7:56:07 PM: yarn build
7:56:07 PM:
7:56:07 PM: Resolved config
7:56:07 PM: build:
7:56:07 PM: command: yarn build
7:56:07 PM: commandOrigin: ui
7:56:07 PM: environment:
7:56:07 PM: - NEXT_PRIVATE_TARGET
7:56:07 PM: publish: /opt/build/repo/.next
7:56:07 PM: publishOrigin: ui
7:56:07 PM: plugins:
7:56:07 PM: - inputs: {}
7:56:07 PM: origin: ui
7:56:07 PM: package: '@netlify/plugin-nextjs'
7:56:07 PM: Caching artifacts
7:56:07 PM: Started saving node modules
7:56:07 PM: Finished saving node modules
7:56:07 PM: Started saving build plugins
7:56:07 PM: Finished saving build plugins
For avoiding such error, is there any way to handle webp images while deploying on netlify?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
