Skip to content

Bug: Server Components error when directly rendering a Context #35340

@samselikoff

Description

@samselikoff

A Server Component that renders <Context> directly will result in a runtime error:

Element type is invalid. Received a promise that resolves to: Context. Lazy element type must resolve to a class or function.

Here's the minimum repro:

import { Context } from './context';

export default function Home() {
  return <Context value={2}>hello</Context>;
}
// context.tsx
'use client';

import { createContext } from 'react';

export const Context = createContext(1);

React version: 19.3.0-canary-378973b3-20251205

Link to code example:

https://github.com/samselikoff/2025-12-09-render-context-from-rsc

The current behavior

Renders without error

The expected behavior

Errors with

Element type is invalid. Received a promise that resolves to: Context. Lazy element type must resolve to a class or function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions