janus-idp / backstage-plugins

Plugins for Backstage
https://janus-idp.io
Apache License 2.0
125 stars 127 forks source link

CLI export-dynamic-plugin fails after backstage update #1843

Open johanneswuerbach opened 1 week ago

johanneswuerbach commented 1 week ago

Describe the bug

Trying the export a package with @janus-idp/cli@1.11.1 package export-dynamic-plugin --clean fails with an error after updating backstage using yarn backstage-cli versions:bump --release 1.27.7:

Error: Backend plugin is not valid for dynamic loading: it should either export a BackendFeature or BackendFeatureFactory as default export, or export a const dynamicPluginInstaller: BackendDynamicPluginInstaller field as dynamic loading entrypoint

Expected Behavior

@janus-idp/cli@1.11.1 package export-dynamic-plugin --clean should work as before.

Debugging

There has been an upstream change https://github.com/backstage/backstage/pull/25098, which is potentially affecting the validate export detection logic of the CLI https://github.com/janus-idp/backstage-plugins/blob/582cf36da48f21f7aa31075430bf566a818a3cfa/packages/cli/src/commands/export-dynamic-plugin/backend-utils.ts#L101-L123.

Sadly this upstream change has been released as a patch release, so everyone locking to ^0.6.x will soon get this change.

Locking the version "@backstage/backend-plugin-api": "0.6.18" inside the package.json of the respective plugin fixes the build.