diff --git a/.changeset/cuddly-bikes-tease.md b/.changeset/cuddly-bikes-tease.md new file mode 100644 index 0000000000..d3fc8bd1bb --- /dev/null +++ b/.changeset/cuddly-bikes-tease.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Fixed a bug where gathered index routes would fail to bind routable extensions. This would typically show up when placing a routable extension in the entity page overview tab. diff --git a/packages/core-app-api/src/routing/collectors.stable.test.tsx b/packages/core-app-api/src/routing/collectors.stable.test.tsx index f8f71a1a9a..de6f350cc9 100644 --- a/packages/core-app-api/src/routing/collectors.stable.test.tsx +++ b/packages/core-app-api/src/routing/collectors.stable.test.tsx @@ -301,7 +301,7 @@ describe('discovery', () => { HELLO }> - + @@ -322,8 +322,8 @@ describe('discovery', () => { [ref1, 'foo'], [ref2, 'foo'], [ref3, 'bar'], - [ref4, 'baz'], - [ref5, 'baz'], + [ref4, ''], + [ref5, ''], ]); expect(sortedEntries(routing.parents)).toEqual([ [ref1, undefined], @@ -337,7 +337,7 @@ describe('discovery', () => { routeObj( 'bar', [ref3], - [routeObj('baz', [ref4, ref5], [], 'gathered')], + [routeObj('', [ref4, ref5], [], 'gathered')], undefined, plugin, ), diff --git a/packages/core-app-api/src/routing/collectors.tsx b/packages/core-app-api/src/routing/collectors.tsx index 815ae534f1..0bf5e676a4 100644 --- a/packages/core-app-api/src/routing/collectors.tsx +++ b/packages/core-app-api/src/routing/collectors.tsx @@ -178,7 +178,7 @@ export const routingV2Collector = createCollector( } if (mountPoint) { - if (!ctx?.gatherPath) { + if (ctx?.gatherPath === undefined) { throw new Error( `Routable extension "${stringifyNode( node,