-
Notifications
You must be signed in to change notification settings - Fork 542
Description
Workspace
rbac
📜 Description
The RBAC backend plugin fails to start with Backstage 1.47.x due to a breaking change in @backstage/[email protected] where the FetchUrlReader constructor was made private.
👍 Expected behavior
The RBAC backend plugin should start successfully with Backstage 1.47.x.
👎 Actual Behavior with Screenshots
The backend fails to start with the following error:
TypeError: Cannot read properties of undefined (reading 'predicate')
at new FetchUrlReader (.../node_modules/@backstage-community/plugin-rbac-backend/node_modules/@backstage/backend-defaults/src/entrypoints/urlReader/lib/FetchUrlReader.ts:135:31)
at permissionFactory (.../node_modules/@backstage-community/plugin-rbac-backend/src/service/plugin-endpoints.ts:125:23)
👟 Reproduction steps
- Upgrade Backstage to 1.47.x using
yarn backstage-cli versions:bump - Ensure
@backstage-community/plugin-rbac-backend@^7.6.1is installed - Run
yarn startoryarn dev - Backend fails during RBAC plugin initialization
📃 Provide the context for the Bug.
In @backstage/[email protected], the FetchUrlReader constructor was made private. The changelog states:
27f9061: BREAKING: The constructor for FetchUrlReader is now private. If you have to construct an instance of it, please use FetchUrlReader.fromConfig instead.
The RBAC plugin still uses the old pattern in plugin-endpoints.ts:
private static permissionFactory: ReaderFactory = () => {
return [{ reader: new FetchUrlReader(), predicate: (_url: URL) => true }];
};Suggested fix: Update to use FetchUrlReader.fromConfig(config) instead of new FetchUrlReader().
Versions
- Backstage: 1.47.2
- @backstage-community/plugin-rbac-backend: 7.6.1
- @backstage/backend-defaults: 0.15.1
Workaround
Downgrade to Backstage 1.46.x which uses @backstage/[email protected].
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
None