Skip to main content

Pterodactyl v1.X

ERROR in resources/scripts/routers/routes.ts

Rarity Difficulty  Pterodactyl Version
Uncommon ★☆☆☆☆  1.X

What is the cause of this error?

At times, you might come across this error while compiling a Pterodactyl panel. Typically, it arises following a modification that could be associated with an addon or theme. This error stems from duplicated lines in the routes.ts file.

Exemple:

ERROR in resources/scripts/routers/routes.ts:39:5
TS2300: Duplicate identifier 'nestId'.
    37 | interface ServerRouteDefinition extends RouteDefinition {
    38 |   permission: string | string[] | null;
39 |     nestId?: number;
       |     ^^^^^^
    40 |     eggId?: number;
    41 |     nestIds?: number[];
    42 |     eggIds?: number[];

ERROR in resources/scripts/routers/routes.ts:40:5
TS2300: Duplicate identifier 'eggId'.
    38 |   permission: string | string[] | null;
    39 |     nestId?: number;
40 |     eggId?: number;
       |     ^^^^^
    41 |     nestIds?: number[];
    42 |     eggIds?: number[];
    43 |   nestId?: number;

ERROR in resources/scripts/routers/routes.ts:41:5
TS2300: Duplicate identifier 'nestIds'.
    39 |     nestId?: number;
    40 |     eggId?: number;
41 |     nestIds?: number[];
       |     ^^^^^^^
    42 |     eggIds?: number[];
    43 |   nestId?: number;
    44 |   eggId?: number;

ERROR in resources/scripts/routers/routes.ts:42:5
TS2300: Duplicate identifier 'eggIds'.
    40 |     eggId?: number;
    41 |     nestIds?: number[];
42 |     eggIds?: number[];
       |     ^^^^^^
    43 |   nestId?: number;
    44 |   eggId?: number;
    45 |   nestIds?: number[];

How can you resolve this issue?

To resolve this issue, follow these steps. It's not difficult; you simply need to open the routes.ts file located in the resources/scripts/routers folder of your Pterodactyl panel and look for something like this:

nestId?: number;
eggId?: number;
nestIds?: number[];
eggIds?: number[];
nestId?: number;
eggId?: number;
nestIds?: number[];
eggIds?: number[];

Change it to something like this:

nestId?: number;
eggId?: number;
nestIds?: number[];
eggIds?: number[];

Afterward, you just need to execute yarn build:production, and the problem will be resolved.