Skip to content

Property 'referrerpolicy' does not exist on type 'HTMLProps<HTMLImageElement>' #1102

@dennisjlee

Description

@dennisjlee

I added the referrerPolicy property to an <img> tag and it failed on svelte-check with typescript enabled (svelte-check --tsconfig ./tsconfig.json).

Error: Type '{ src: any; referrerpolicy: string; }' is not assignable to type 'HTMLProps<HTMLImageElement>'.
  Property 'referrerpolicy' does not exist on type 'HTMLProps<HTMLImageElement>'. (ts)

Example source:

<img src="https://domain.com/myImage.jpg"
         referrerPolicy="no-referrer" />

It looks like this would be fixed by adding referrerpolicy to the long list of accepted HTML props in https://github.com/sveltejs/language-tools/blob/master/packages/svelte2tsx/svelte-jsx.d.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions