nextjs - ✅(Solved) Fix Turbopack: importing `.avif` files fails with ‘AVIF image not supported’ warnings [1 pull requests, 19 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86392Fetched 2026-04-08 02:11:11
View on GitHub
Comments
19
Participants
5
Timeline
28
Reactions
4
Author
Timeline (top)
commented ×19subscribed ×5labeled ×2cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #88094: Turbopack: enable AVIF

Description (problem / solution / changelog)

Closes #86392

Looks like we'll have to wait for https://github.com/image-rs/image/issues/2621

   Compiling pest_generator v2.7.9
error: failed to run custom build command for `dav1d-sys v0.8.3`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/build/target/release/build/dav1d-sys-4f0809c2a7512218/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dav1d-sys-0.8.3/Cargo.toml
  cargo:rerun-if-env-changed=DAV1D_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr

  thread 'main' (17515) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dav1d-sys-0.8.3/build.rs:82:10:
  called `Result::unwrap()` on an `Err` value: PkgConfig(`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "dav1d" "dav1d >= 1.3.0"` did not exit successfully: exit status: 1
  error: could not find system library 'dav1d' required by the 'dav1d-sys' crate

Changed files

  • Cargo.lock (modified, +273/-71)
  • Cargo.toml (modified, +1/-1)
  • crates/napi/Cargo.toml (modified, +1/-3)
  • packages/next-swc/package.json (modified, +2/-2)
  • turbopack/crates/turbopack-image/Cargo.toml (modified, +2/-2)
  • turbopack/crates/turbopack-image/src/process/mod.rs (modified, +3/-23)

Code Example

$ pnpm build

> @ build /project/workspace
> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
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:
https://nextjs.org/telemetry

Next.js 16.0.2-canary.27 (Turbopack)

  Creating an optimized production build ...
Turbopack build encountered 1 warnings:
./app/a.avif
AVIF image not supported
This version of Turbopack does not support AVIF images, will emit without optimization or encoding

Import trace:
  Server Component:
    ./app/a.avif
    ./app/page.tsx


Compiled successfully in 2.6s
Finished TypeScript in 2.5s    
Collecting page data using 3 workers in 399.3ms    
Generating static pages using 3 workers (4/4) in 136.9ms
Finalizing page optimization in 12.9ms    

Route (app)
┌ ○ /
└ ○ /_not-found


  (Static)  prerendered as static content

---

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 8198
  Available CPU cores: 4
Binaries:
  Node: 20.12.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 16.0.2-canary.27 // Latest available version is detected (16.0.2-canary.27).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/sleepy-stitch-xhgd6r?file=%2Fapp%2Fpage.tsx

<img width="1436" height="856" alt="Image" src="https://github.com/user-attachments/assets/f0ec2170-9a35-47c1-9772-cf979fbca367" />

To Reproduce

  1. Import an .avif file using a static import statement
  2. Build with Turbopack -> warns about AVIF not being supported 💥

Current vs. Expected behavior

Currently, Turbopack shows a warning about AVIF imports:

$ pnpm build

> @ build /project/workspace
> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
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:
https://nextjs.org/telemetry

▲ Next.js 16.0.2-canary.27 (Turbopack)

  Creating an optimized production build ...
Turbopack build encountered 1 warnings:
./app/a.avif
AVIF image not supported
This version of Turbopack does not support AVIF images, will emit without optimization or encoding

Import trace:
  Server Component:
    ./app/a.avif
    ./app/page.tsx


✓ Compiled successfully in 2.6s
✓ Finished TypeScript in 2.5s    
✓ Collecting page data using 3 workers in 399.3ms    
✓ Generating static pages using 3 workers (4/4) in 136.9ms
✓ Finalizing page optimization in 12.9ms    

Route (app)
┌ ○ /
└ ○ /_not-found


(Static)  prerendered as static content

webpack supports .avif imports

Expected: Turbopack supports AVIF

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 8198
  Available CPU cores: 4
Binaries:
  Node: 20.12.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 16.0.2-canary.27 // Latest available version is detected (16.0.2-canary.27).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

--

extent analysis

TL;DR

  • The most likely fix is to upgrade or configure Turbopack to support AVIF images, as the current version does not support them.

Guidance

  • Verify that the issue is indeed related to Turbopack's lack of support for AVIF images by checking the build warnings and the import trace.
  • Consider using a different image format that is supported by Turbopack, such as JPEG or PNG, as a temporary workaround.
  • Check the Next.js and Turbopack documentation for any updates or configuration options that may enable AVIF support.
  • If possible, test the build process with a different version of Turbopack or Next.js to see if the issue is specific to the current version.

Notes

  • The issue seems to be specific to Turbopack, as webpack is mentioned to support AVIF imports.
  • The provided environment information and package versions may be relevant in troubleshooting the issue.

Recommendation

  • Apply workaround: Use a different image format, such as JPEG or PNG, until Turbopack supports AVIF images, as upgrading to a fixed version is not currently an option.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING