#cannot use typescript inside component `<script>` tags

12 messages · Page 1 of 1 (latest)

sage belfry
#
---
---

<section>
    <slot />
</section>

<script defer>
    const test = 1 as number
     //                ^ Type assertion expressions can only be used in TypeScript files.ts(8016)

</script>

This is the error I'm having.

#

I get typescript checking but can't use typescript annotation

tidal wadi
#

remove defer

sage belfry
#

wtf

#

do you know why ?

#

thanks btw

tidal wadi
#

yes i will get a link to docs

#

see the note about attributes

sage belfry
#

thanks, I didn't pay attention to the note