Error TS2374: Duplicate index signature for type 'number'. #7559
Unanswered
smadarapu01
asked this question in
Q&A
Replies: 1 comment
-
This TypeScript error occurs when there are two fields with the same type of keys and values in one interface: interface Test {
[key1: string]: string;
[key2: string]: string;
} It may be because of the "interface merging" feature in TypeScript: // file 1
interface Test {
[key1: string]: string;
}
// file 2
interface Test {
[key2: string]: string;
} Can you do If they come from two packages, the simplest way is to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
we just recently updated to pnpm from yarn, while compiling application, seeing Error TS2374: Duplicate index signature for type 'number'. errors. We use typescript,
Tried with clearing cache still seeing issue can you pls help on this. brief details from log
symlick
/node_modules/.pnpm/@types+jquery@3.5.22/node_modules/@types/jquery/JQuery.d.ts(13361,5): error TS2374: Duplicate index signature
for type 'number'.
node_modules/.pnpm/@types+jquery@3.5.22/node_modules/@types/jquery/legacy.d.ts(201,5): error TS2374: Duplicate index signature for type 'string'.
root folder
/node_modules/@types/jquery/jquery.d.ts(13361,5): error TS2374: Duplicate index signature for type 'number'.
/node_modules/@types/jquery/legacy.d.ts(201,5): error TS2374: Duplicate index signature for type 'string'.
Beta Was this translation helpful? Give feedback.
All reactions