Skip to content

Row component fails in Storybook with "React is not defined" error in Rush monorepo #88

@Crater-exe

Description

@Crater-exe

Bug Report

Description

The Row component from @lightningtv/solid/primitives throws "React is not defined" error when used in Storybook within a Rush monorepo, but works fine in standalone projects.

Environment

  • @lightningtv/solid: 3.0.10
  • @lightningjs/renderer: 3.0.0-beta21
  • Storybook: 9.1.17 with storybook-solidjs-vite
  • Rush monorepo with pnpm

Error

ReferenceError: React is not defined
at Row (Row.tsx:32:3)

Reproduction

  1. Works: Clone lightning-tv/solid-starter-template, add Row to Storybook → works perfectly
  2. Fails: Same Row component in Rush monorepo with pnpm → React error

Root Cause Analysis

Rush + pnpm hoists Storybook's React dependencies to shared common/temp/node_modules/.pnpm/. The Row component appears to detect React's presence and tries to use it, but fails because React 19 has no default export.

Configuration Attempted

  • React shim aliases
  • optimizeDeps exclusions
  • Multiple Vite configurations
  • Package version matching (App is using older versions and I tried upgrading to the latest)

The issue appears to be that @lightningtv/solid has conditional React usage that conflicts with hoisted React in monorepos.

Expected Behavior

Row component should work in monorepo environments without React conflicts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions