Pterodactyl v1.X
ERROR in resources/scripts/api/server/getServer.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 getServer.ts file.
Exemple:
ERROR in resources/scripts/api/server/getServer.ts:22:3
TS2300: Duplicate identifier 'nestId'.
20 | eggId: number;
21 | isNodeUnderMaintenance: boolean;
22 | nestId: number;
| ^^^^^^
23 | status: ServerStatus;
24 | sftpDetails: {
25 | ip: string;ERROR in resources/scripts/api/server/getServer.ts:49:3
TS2300: Duplicate identifier 'nestId'.
47 | allocations: Allocation[];
48 | mcversion: string;
49 | nestId: number;
| ^^^^^^
50 | eggId: number;
51 | }
52 |ERROR in resources/scripts/api/server/getServer.ts:50:3
TS2300: Duplicate identifier 'eggId'.
48 | mcversion: string;
49 | nestId: number;
50 | eggId: number;
| ^^^^^
51 | }
52 |
53 | export const rawDataToServerObject = ({ERROR in resources/scripts/api/server/getServer.ts:89:3
TS1117: An object literal cannot have multiple properties with the same name.
87 | ).map(rawDataToServerAllocation),
88 | mcversion: data.mcversion,
89 | nestId: data.nest_id,
| ^^^^^^
90 | eggId: data.egg_id,
91 | });
92 |
How can you resolve this issue?
Method 1 - Even easier
The first way to resolve this problem is really easy. You need to go in your resources/scripts/api/server
folder and upload this getServer.ts
file.
Afterward, you just need to execute yarn build:production
, and the problem will be resolved.
Method 2 - Easy
To effectively rectify this issue, please adhere to the following steps. It is a straightforward process that involves accessing the getServer.ts
file located within the resources/scripts/api/server
directory of your Pterodactyl panel. Within this file, identify all occurrences of the following:
nestId: number;
If you happen to find this mentioned more than once, that is likely the root of the problem. Please retain only a single occurrence and eliminate any duplicates. Similarly, carry out the same procedure for the following occurrences:
eggId: number;
nestId: data.nest_id
eggId: data.egg_id
Afterward, you just need to execute yarn build:production
, and the problem will be resolved.