Skip to content

Blank page is rendered on certain unavailable paths instead of a 404 #6260

Description

@FrancescoMolinaro

Describe the bug

Navigating to a module's base path without an object ID — e.g. /items or /collections — renders a blank page instead of a proper 404 Page Not Found.

The cause is in the route configuration. In app-routes.ts, items and collections are valid top-level segments (they map via loadChildren to item-page-routes.ts and collection-page-routes.ts respectively). Once the router commits to one of these branches, it tries to match the remaining (empty) URL segment against the module's child routes. However, those child route arrays only define :id-based routes (and version / create), with no path: '' fallback and no ** wildcard. The empty segment matches nothing, so the router outlet has nothing to render — producing a blank page. Because top-level matching succeeded, the global { path: '**' } 404 route is never reached.

By contrast, /entities correctly returns a 404 because its route requires an :entity-type segment (entities/:entity-type), so it falls through to the global wildcard.

To Reproduce

Steps to reproduce the behavior:

In the browser, navigate directly to /items (or /collections).
Observe that a blank page is rendered.

Expected behavior

Navigating to a module base path without a valid object ID (e.g. /items, /collections) should render the 404 Page Not Found page (ideally redirecting to the dedicated error route so the URL reflects the error and SSR can return a proper 404 status), consistent with the behavior of /entities.

Related work

n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageNew issue needs triage and/or scheduling

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions