Skip to content

Bug: Lazily loading dependencies does not function properly in App with nested plugins #2172

@mckn

Description

@mckn

Which package(s) does this bug affect?

  • Create Plugin
  • Sign Plugin
  • Plugin E2E
  • Plugin Meta Extractor
  • Plugin ESLint Rules

Package versions

What happened?

We scaffolded an app plugin that has a panel plugin located within a panel folder in the plugin (nesting two different plugins). When the panel tries to lazily load dependencies it try to fetch them from the following path:

GET /public/plugins/grafana-medtech-panel

But with the current build config the vendor dependencies are placed in the dist folder of the root app plugin. So if I change the path to:

GET /public/plugins/grafana-medtech-app

I can fetch the dependency successfully. I guess in this edge case we should try to fetch all lazily loaded plugins from the root plugin path instead of the path of the nested plugin.

What you expected to happen

It should load all dependencies successfully. I'm not sure what the right call is here.

I guess we have two options:

  1. Make sure that for nested plugins we try to fetch all dependencies from the root plugin path.
  2. When building a plugin with nested plugins in it: emit the dependencies in the nested plugin's path.

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

  1. Clone this repo and use the linked commit: https://github.com/hugohaggmark/grafana-medtech-app/tree/e275a66120bd56a56896af55db14c2be1b44cbac
  2. npm i && mage -v
  3. npm run dev
  4. docker compose up
  5. Go into the provisioned dashboard and check the network tab.

Environment

n/a

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    💡 Ideation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions