Skip to content

Invalid Syntax but no warning #15868

@MrAmericanMike

Description

@MrAmericanMike

Describe the bug

So I was following the tutorials on the website, and came across this issue.

This syntax doesn't create a warning and works:

<script>
	import PackageInfo from './PackageInfo.svelte';

	const pkg = {
		name: 'svelte',
		version: 5,
		description: 'blazing fast',
		website: 'https://svelte.dev'
	};
</script>

<PackageInfo <PackageInfo {...pkg} PackageInfo {...pkg} {...pkg} {...pkg} />

Also tested on a local project a more basic attempt to reproduce, and this also works, even when it's unvalid.

<script>
	import NavBar from "$/components/NavBar.svelte";
	import "../global.css";
</script>

<NavBar <Navbar />

<slot />

Reproduction

Visit https://svelte.dev/tutorial/svelte/spread-props and try the solution on the report.

Logs

System Info

Binaries:
    Node: 22.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.10.0 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.730.0), Chromium (112.0.1722.58)  
    Internet Explorer: 11.0.22621.1
  npmPackages:
    svelte: 5.28.2 => 5.28.2

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