---
url: >-
  https://lit-ui-router.dev/reference/ui-router-server/index/functions/diagnoseMounts.md
---
[ui-router-server](../../index.md) / [ui-router-server](../index.md) / diagnoseMounts

# Function: diagnoseMounts()

```ts
function diagnoseMounts(router): MountDiagnostic[];
```

Defined in: [index.ts:1158](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L1158)

Checks the mounts a router was built with for configurations that compile
but misroute, without logging: the findings the development build of
[createServerRouter](createServerRouter.md) warns about, returned in every build.
It reports `'bareBaseNotFound'` for a mount other than '/' whose bare base
(`/app`) answers 404 — `notFound`, or the shell-404 of an `otherwise`
projection. Findings follow the table's declaration order. Assert the
result is empty in a test to catch them in CI.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `router` | [`ServerRouter`](../interfaces/ServerRouter.md) | a router from this copy of the package's `createServerRouter` |

## Returns

[`MountDiagnostic`](../interfaces/MountDiagnostic.md)\[]

## Throws

for any other object, such as a structural fake or a router from a
second copy of the package

## Example

```ts
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { createServerRouter, diagnoseMounts } from 'ui-router-server';

// The table the server passes to createServerRouter.
const mounts = { '/app': { routes: [{ name: 'home', url: '' }] } };

test('every mount serves its bare base', () => {
  assert.deepEqual(diagnoseMounts(createServerRouter({ mounts })), []);
});
```
