Skip to content

Allow use of setContext in async contexts #17970

@sirkostya009

Description

@sirkostya009

Describe the problem

no pun intended.

ex.:

<script>
	import { setContext } from "svelte";

	async function foo() {
		return await 1;
	}

	setContext({}, await foo())
</script>

causes errors like:

Svelte error: missing_context
Context was not set in a parent component
https://svelte.dev/e/missing_context

Describe the proposed solution

Make it work

Importance

would make my life easier

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