Skip to content

Deprecated warning suggests code that doesn't work! #9184

Description

@lizlooney

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

I had code that called workspace.getVariableUsesById(id). The deprecation warning says to use Blockly.Workspace.getVariableMap().getVariableUsesById, but that doesn't work.

workspace.getVariableMap() returns an IVariableMap<IVariableModel<IVariableState>>, but IVariableMap does not have a function named getVariableUsesById.

Reproduction steps

  1. Write code that uses workspace.getVariableUsesById(id)
  2. Run it and look at the browser console. See Blockly.Workspace.getVariableUsesById was deprecated in v12 and will be deleted in v13. Use Blockly.Workspace.getVariableMap().getVariableUsesById instead.
  3. Replace code with workspace.getVariableMap().getVariableUsesById (id).
  4. Observe error (in my case I see this error in vscode): Property 'getVariableUsesById' does not exist on type 'IVariableMap<IVariableModel<IVariableState>>'. Did you mean 'getVariableById'?

Stack trace

Screenshots

No response

Browsers

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions