You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
config.d.ts union type precedence bug causes config validation failure for dynatrace.environments #331
The TypeScript union type definition for environments in plugins/dql-backend/config.d.ts has incorrect operator precedence, causing Backstage's config schema compiler to generate an object type instead of an array type. This makes the app fail to start with a config validation error when using the documented array format for dynatrace.environments.
Expected Behavior
Backstage should start successfully when dynatrace.environments is configured as an array, as shown in the plugin's own README documentation:
Backstage fails to start with the following error:
Plugin 'app' threw an error during startup. Invalid app bundle schema.
Caused by: Config validation failed, Config must be object { type=object } at /dynatrace/environments
Due to TypeScript operator precedence, this is parsed as OAuthConfig | (TokenConfig[]) — a union of a single object or an array. Backstage's config schema compiler picks the first branch (object) and generates { type: "object" } for the JSON schema.
The fix is to wrap the union in parentheses so the array applies to both types:
This makes it unambiguously (OAuthConfig | TokenConfig)[] — an array of either type, which matches the documented config format.
Context
This prevents deploying Backstage with the Dynatrace DQL plugin in any environment where the app bundle is built.
The error occurs in @backstage/plugin-app-backend at readFrontendConfig.cjs.js:26 during config schema validation against the compiled app bundle.
Activity
fix(validate): read the schema this repo ships, not the one npm publi…
fix(metadata): clear the appConfigExamples schema backlog (RHIDP-1590…