SolidJSS
SolidJSโ€ข3y agoโ€ข
8 replies
Bersaelor

`crossOrigin` and `playsInline` types don't work with solid & typescript

When running tsc --jsx preserve -t es2020 --outDir js --noEmit false on my solidjs site, I get the following compile errors. What gives?
src/components/MainPlayer.tsx:117:18 - error TS2322: Type '{ children: Element; playsInline: true; }' is not assignable to type 'AudioHTMLAttributes<HTMLAudioElement>'.
  Property 'playsInline' does not exist on type 'AudioHTMLAttributes<HTMLAudioElement>'.

117           <audio playsInline>
                     ~~~~~~~~~~~

src/components/OGHeader.tsx:40:63 - error TS2322: Type 'true' is not assignable to type 'HTMLCrossorigin | undefined'.

40       <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin/ >
                                                                 ~~~~~~~~~~~

  node_modules/solid-js/types/jsx.d.ts:872:5
    872     crossOrigin?: HTMLCrossorigin;
            ~~~~~~~~~~~
    The expected type comes from property 'crossOrigin' which is declared here on type 'LinkHTMLAttributes<HTMLLinkElement>'
Screenshot_2023-03-05_at_21.22.03.png
Was this page helpful?