Skip to content

warningFilter stopped working with Svelte 5.10.0 #14654

Closed
@forna

Description

@forna

Describe the bug

I have set the below warningFilter option in svelte.config.js.
It works up to [email protected], starting with [email protected] it has no effect.
See also: https://github.com/sveltejs/vite-plugin-svelte/issues/988

compilerOptions: {
		warningFilter(w){
			return w.message !== 'Unused CSS selector "*"'
		}
	},

Reproduction

I can reproduce it with this svelte component:

<script>
    import {Circle2} from "svelte-loading-spinners"

    // Props
    let {loadSpinner}  = $props()

    // Spinner type
    const spinnerType = "Circle2"

    // Spinner size in pixels
    const size = 70

</script>


{#if loadSpinner}
    {#if spinnerType === "Circle2"}
        <Circle2 size={size} colorOuter="#8A2BE2" colorCenter="#46B4FD" colorInner="#FFD700" durationOuter="2s" durationCenter="1.5s" durationInner="1s" />
    {/if}
{/if}


<style>
    :global {
        .circle, .wrapper {  /* .circle.svelte-1w4sjib .wrapper.svelte-7wj78d */
            position: fixed; /* Use fixed positioning to keep it in the center of the screen */
            top: 50%;
            left: 50%;
            margin-top: var(--margin-top); /* Half of the spinner size */
            margin-left: var(--margin-left); /* Half of the spinner size */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000; /* Ensure it is above other content */
        }
    }
</style>

Logs

16:57:48 [vite-plugin-svelte] src/lib/components/component/Spinner.svelte:37:1 Unused CSS selector "*"

System Info

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions