Skip to content

fix: prevent nullish snippet for rendering empty content#13083

Merged
trueadm merged 7 commits intomainfrom
snippet-chain
Sep 5, 2024
Merged

fix: prevent nullish snippet for rendering empty content#13083
trueadm merged 7 commits intomainfrom
snippet-chain

Conversation

@trueadm
Copy link
Copy Markdown
Contributor

@trueadm trueadm commented Aug 30, 2024

Fixes #12999.

If the snippet function is nullish and not a chain expression we now throw an error to have parity with non-dynamic references.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: a241a5a

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

Comment thread packages/svelte/src/internal/client/dom/blocks/snippet.js Outdated
@WarningImHack3r
Copy link
Copy Markdown

Typo man here again, shouldn't you backtick `null` and `undefined` in the error bodies?

Comment thread packages/svelte/src/internal/client/dom/blocks/snippet.js Outdated
Comment thread packages/svelte/src/internal/client/dom/blocks/snippet.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No error for @render undefined if snippet function is state

5 participants