# NextjsParser

**Kind:** Class

**Source:** [`atloria-monorepo/apps/frontend-parser/src/parsers/nextjs.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/frontend-parser/src/parsers/nextjs.parser.ts#L53)

**Extends:** `ReactParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |

## Properties

| Property | Type |
|---|---|
| `name` | `string` |
| `version` | `string` |
| `supportedPatterns` | `string[]` |

## Where it refuses work

- `NextjsParser` stops the work with an early return when `this.isRouteHandler(filePath)`.
- `NextjsParser` stops the work with an early return when `!content.trim()`.
- `NextjsParser` stops the work with an early return when `route === '/'`.
- `NextjsParser` stops the work with an early return when `/\/app\/page\.(tsx|jsx|ts|js)$/.test(filePath)`.
- `NextjsParser` stops the work with an early return when `route === 'index'`.
- `NextjsParser` stops the work with an early return when `match`.

## When something fails

- `NextjsParser` handles failure in 2 places: it turns it into a return value in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.
