fix: correctly analyze <object.property> components
#16711
<object.property> componentsClosing issue
Describe the bug
Snippets don't have the correct scope for when variables are used as components
<script lang="ts">
import { motion } from "./motion.svelte";
const layout = motion;
</script>
<!-- THIS WORKS -->
<!-- <layout.ul>Hello World</layout.ul> -->
<!-- THIS DOESN'T WORK -->
{@render test()}
{#snippet test()}
<layout.ul>Hello World</layout.ul>
{/snippet}
Reproduction
System Info
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M2 Max
Memory: 101.75 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.21 - /opt/homebrew/bin/yarn
npm: 10.9.2 - /opt/homebrew/bin/npm
pnpm: 10.13.1 - /opt/homebrew/bin/pnpm
bun: 1.2.19 - ~/.bun/bin/bun
Watchman: 2025.04.28.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 140.0.7339.80
Edge: 139.0.3405.125
Safari: 18.5
npmPackages:
svelte: ^5.0.0 => 5.38.6
Severity
annoyance
Pull request
Merged
O
Ocean-OS Sep 4, 2025, 6:58 AMCloses #16708
Before submitting the PR, please make sure you do the following
- It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- Prefix your PR title with
feat:,fix:,chore:, ordocs:. - This message body should clearly illustrate what problems it solves.
- Ideally, include a test that fails without this PR but passes with it.
- If this PR changes code within
packages/svelte/src, add a changeset (npx changeset).
Tests and linting
- Run the tests with
pnpm testand lint the project withpnpm lint
Info
Merged at Sep 11, 2025, 12:20 AM
Merged by Rich-Harris
Assignees None
Reviewers None
Labels None
Milestone None
C
changeset-bot[bot] Sep 4, 2025, 6:59 AM🦋 Changeset detected
Latest commit: 2de7ba1
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| svelte | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
G
github-actions[bot] Sep 4, 2025, 7:00 AMpnpm add https://pkg.pr.new/svelte@16711 S
svelte-docs-bot[bot] Sep 11, 2025, 12:15 AMPull request open Sep 4, 2025, 6:58 AM
Pull request merged Sep 11, 2025, 12:20 AM
Total -1 +25