You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Classes in a component with <script lang="ts>… get ignored by the preprocessor, when they don't have their own <style windi:preflights:global windi:safelist:global>….
<script>
import { onMount } from'svelte';let content;onMount(() => { content ='Hello world from Javascript component'; });
</script>
<divclass="bg-red-500">
{content}. This should be red. And it is.
</div>
Doesn't work:
<scriptlang="ts">
import { onMount } from'svelte';let content:string;onMount(() => {content='Hello world from Typescript component'; });
</script>
<divclass="bg-green-500">
{content}. This should be green. But it's not.
</div>
Related (?): Empty windi-style-tags with closing tag on same line result in errors (in VSCode) but compile fine:
No error:
I also ran into this problem in using typescript and windi. Isn't it the same problem as #374? It's solved for me by setting the package to ~4.1.0 as mentioned.
Describe the bug
Classes in a component with
<script lang="ts>…
get ignored by the preprocessor, when they don't have their own<style windi:preflights:global windi:safelist:global>…
.See simple repository with examples: https://github.com/toolongformore/svelte-windicss-preprocess-ts-bug/
Works:
Doesn't work:
Related (?): Empty windi-style-tags with closing tag on same line result in errors (in VSCode) but compile fine:
No error:
Error:
System Info
Used Package Manager
npm
The text was updated successfully, but these errors were encountered: