Skip to content

Could not use next/future/image with imported image and fill layout #39807

@armandabric

Description

@armandabric

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: Ubuntu 20.04.0 LTS Mon Aug 22 2022 11:46:31 GMT+0200 (Central European Summer Time)
Binaries:
  Node: 16.14.2
  npm: 7.17.0
  Yarn: 1.22.10
  pnpm: 7.9.4-0
Relevant packages:
  next: 12.2.6-canary.1
  eslint-config-next: N/A
  react: 17.0.1
  react-dom: 17.0.1

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When using an imported image and the fill layout with the new image component it throw an error:

Error: Image with src "/_next/static/media/bar.ddd5bcf8.svg" has both "width" and "fill" properties. Only one should be used.

Expected Behavior

The doc seems to allow this use case. So we should be able to use the fill layout with an imported image.

Link to reproduction

https://stackblitz.com/edit/nextjs-future-image-fill-bug?file=pages/index.js

To Reproduce

Open the sand box

Metadata

Metadata

Assignees

No one assigned

    Labels

    Image (next/image)Related to Next.js Image Optimization.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions