Closed SavinDevelop closed 1 week ago
Astro v4.10.3 Node v22.3.0 System Linux (x64) Package Manager bun Output static Adapter none Integrations @astrojs/tailwind @astrojs/vue astro-icon
No response
Typescript throws an error on the props type for the image component, even though I'm doing everything as described in the documentation.
--- import image1 from '@assets/1.jpg'; import { Image } from 'astro:assets'; --- <Image src={image1.src} alt="image" />
Type '{ src: string; alt: string; }' is not assignable to type 'IntrinsicAttributes & Props'. Type '{ src: string; alt: string; }' is not assignable to type 'IntrinsicAttributes & { [x: `data-${string}`]: any; title?: string | null | undefined; children?: unknown; class?: string | null | undefined; 'class:list'?: string | Record<string, boolean> | Record<...> | Iterable<...> | Iterable<...> | undefined; ... 203 more ...; inferSize?: false | undefined; }'.
I want to solve this problem
None
Remove .src from your code, you're using the syntax for img tags, not Image.
.src
img
Image
https://docs.astro.build/en/guides/images/#images-in-astro-files
I feel ashamed of my inattention
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Typescript throws an error on the props type for the image component, even though I'm doing everything as described in the documentation.
What's the expected result?
I want to solve this problem
Link to Minimal Reproducible Example
None
Participation