From 45c875e11a4deb26ddc538357026493d1e417a29 Mon Sep 17 00:00:00 2001 From: RONGALI MOHAN KRISHNA 2400033266 <2400033266@kluniversity.in> Date: Thu, 27 Nov 2025 12:19:11 +0530 Subject: [PATCH] fix(v3): include key in inject() warning message Improves the warning message in the inject() function to include the key being injected. This addresses issue #13287 where users were unable to identify which inject() call was failing without the key information in the warning message. Changes made: - Modified src/v3/apiInject.ts line 69 to include the injected key in the warning message - The warning now displays: inject() can only be used inside setup() or functional components. - This matches the pattern used in the error message on line 66 --- src/v3/apiInject.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/v3/apiInject.ts b/src/v3/apiInject.ts index 76928268b13..76d1a0526bd 100644 --- a/src/v3/apiInject.ts +++ b/src/v3/apiInject.ts @@ -66,6 +66,5 @@ export function inject( warn(`injection "${String(key)}" not found.`) } } else if (__DEV__) { - warn(`inject() can only be used inside setup() or functional components.`) - } + warn(`inject(${String(key)}) can only be used inside setup() or functional components.`) }