diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index 3e6aa1e8..064cca90 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -1201,9 +1201,11 @@ export function createContext( */ export function useContext(context: Context): T { let value: undefined | T; - return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined - ? value - : context.defaultValue; + let ctx = Owner && Owner.context && (value = Owner.context[context.id]) !== undefined + ? value + : context.defaultValue; + IS_DEV && !ctx && console.warn("`useContext` is returning undefined. Is it being called inside a provider?") + return ctx; } export type ResolvedJSXElement = Exclude;