Skip to content

UppyContextProvider.svelte generates https://svelte.dev/e/state_referenced_locally warning #6140

@Alexander-Jordan

Description

@Alexander-Jordan

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

  1. Include @uppy/svelte in your project (I'm using version 4.6.2).
  2. Build your assets.

This is the warning:

Module Warning (from ./node_modules/svelte-loader/index.js):
state_referenced_locally: This reference only captures the initial value of `uppy`. Did you mean to reference it inside a derived instead?
https://svelte.dev/e/state_referenced_locally
node_modules/@uppy/svelte/dist/components/headless/UppyContextProvider.svelte:9:4
 7: // Create a single reactive context object
 8: const contextValue = $state({
 9:     uppy,
            ^
10:     status: 'init',
11:     progress: 0,

Expected behavior

This warning should not be generated.

Actual behavior

The https://svelte.dev/e/state_referenced_locally warning is generated on assets build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions