Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message on
next/future/image
when objectFit
or `obj…
…ectPosition` (#39614) Improve PR improves the error message on `next/future/image` when `objectFit` or `objectPosition` is provided and suggests using `style` instead. It also prints the stack trace so its clear where the error came from.
- Loading branch information
Showing
3 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/integration/image-future/default/pages/invalid-objectfit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import Image from 'next/future/image' | ||
|
||
const Page = () => { | ||
return ( | ||
<div> | ||
<Image | ||
src="/test.jpg" | ||
width="400" | ||
height="400" | ||
objectFit="contain" | ||
objectPosition="20% 20%" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters