[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/inertia](../README) / InvalidComponentError

# Class: InvalidComponentError

Defined in: [inertia/src/errors.ts:29](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/inertia/src/errors.ts#L29)

Thrown when a component name is unsafe (path traversal) or has no resolvable default export.

## Extends

- [`InertiaError`](InertiaError)

## Constructors

### Constructor

> **new InvalidComponentError**(`component`, `reason?`): `InvalidComponentError`

Defined in: [inertia/src/errors.ts:30](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/inertia/src/errors.ts#L30)

#### Parameters

##### component

`string`

##### reason?

`string` = `"is not a valid component"`

#### Returns

`InvalidComponentError`

#### Overrides

[`InertiaError`](InertiaError).[`constructor`](InertiaError#constructor)

## Properties

### code

> `readonly` **code**: `string`

Defined in: [core/src/errors/ZerotalError.ts:18](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/errors/ZerotalError.ts#L18)

#### Inherited from

[`InertiaError`](InertiaError).[`code`](InertiaError#code)

***

### status

> `readonly` **status**: `number` = `500`

Defined in: [core/src/errors/ZerotalError.ts:19](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/errors/ZerotalError.ts#L19)

#### Inherited from

[`InertiaError`](InertiaError).[`status`](InertiaError#status)

***

### context?

> `readonly` `optional` **context?**: `Record`\<`string`, `unknown`\>

Defined in: [core/src/errors/ZerotalError.ts:20](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/errors/ZerotalError.ts#L20)

#### Inherited from

[`InertiaError`](InertiaError).[`context`](InertiaError#context)
