Skip to content

onRender and onInit share the same "references" in the code editor #46

@ZuperZee

Description

@ZuperZee

What happened:
Writing code in onRender or onInit makes variables show in the other as references.
image

The code crashes if they are used.
image

What you expected to happen:
The editors shouldn't reference each other.

How to reproduce it (as minimally and precisely as possible):

  1. Create a variable in onInit
  2. Type out the variable in onRender
  3. Press ctrl + space (doesn't have to be the full variable name)

Panel options

{
    "onRender": "otherFile",
    "onInit": "const otherFile = \"Hey\";"
}

Anything else we need to know?:

Environment:

  • Grafana version: v8.2.0
  • Plugin (gapit-htmlgraphics-panel) version: v1.3.3
  • Data source type & version:
  • OS Grafana is installed on: Windows 10 (Ubuntu WSL)
  • User OS & Browser: Chrome
  • Grafana plugins:
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions