Impossible to dynamically load a number of upstream backend plugins
davidfestal opened this issue · comments
David Festal commented
Describe the bug
There is currently a limitation in the dynamic backend plugin loading mechanism that makes it impossible to dynamically load a number of upstream backend plugins.
More precisely, the dynamic backend plugin loading mechanism does not support the resolvePackagePath()
method of the @backstage/backend-common
core package.
So all plugins that use this "reflection" method in order to retrieve the folder where the plugin has been installed (and thus get resources inside it), especially all the plugins that use the database service (and thus use this function at loading time, like this) will fail loading.
Expected Behavior
What are the steps to reproduce this bug?
- Convert the upstream
tech-insights-backend
plugin to dynamic by running thenpx --package=@janus-idp/cli@1.7.5 janus-cli package export-dynamic-plugin
- Create a package archive for the dynamic plugin package:
cd dist-dynamic && npm pack
- Install this dynamic plugin in the Backstage-shiwcase application
- You will get an error saying that it cannot resolve the
@backstage/plugin-tech-insights-backend-dynamic/package.json
module.