-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The responsive layout is incompatible with a Flexbox container #27644
Comments
An update on this issue: |
This is a known issue for There's a proposal to add In the meantime, you can use a wrapper import Image from "next/image";
export default function Home() {
return (
<div style={{ display: "flex" }}>
<div style={{ width: "100%" }}>
<Image
src="/sunset1.jpg"
alt="Sunset"
width={600}
height={450}
layout="responsive"
/>
</div>
</div>
);
} https://codesandbox.io/s/determined-taussig-jjn9w?file=/pages/index.js |
Thank you very much @styfle for your reply and the temporary solution you suggested. |
Tested with the latest 11.1.0. The bug still persists. |
PR #28221 was released to the canary channel, it just prints a warning. You can try it out with |
Thanks @styfle but, unfortunately, I don't see any related warnings in the browser or server console. |
I tried the following code and removed the Can you provide an example that doesn't print the warning? |
Thanks @styfle, |
JFYI, setting .container {
display: flex;
flex-direction: column;
} |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.16.1
What browser are you using?
Chrome
What operating system are you using?
Ubuntu 20.04.2 LTS
How are you deploying your application?
yarn start
Describe the Bug
Images with the responsive layout are not displayed on the page if put inside a flexbox container.
Expected Behavior
Responsive images should be visible.
To Reproduce
npx create-next-app next-image-flexbox-bug cd next-image-flexbox-bug
http://localhost:3000/next-image-flexbox-bug
The text was updated successfully, but these errors were encountered: