Skip to content

Babel instrumentation crashes on qualified TypeScript names inside JSX expressions #45

Description

@stackloomdev

Reproduction

Using [email protected], transform this TSX:

import * as React from "react";

export function Sidebar({ style }: React.ComponentProps<"div">) {
  return (
    <div
      style={{ "--sidebar-width": "16rem", ...style } as React.CSSProperties}
    />
  );
}

Observed

The development transform fails with:

Property left of TSQualifiedName expected node to be of a type ["TSEntityName"] but instead got "CallExpression"

Root cause

Expression-input traversal visits the React identifier in the type-only React.CSSProperties subtree and wraps it as a runtime capture call, producing an invalid TSQualifiedName AST.

Acceptance criteria

  • TypeScript-only subtrees are not instrumented.
  • Runtime values inside the surrounding assertion, such as style, remain traceable.
  • Generated TSX reparses successfully.
  • The real-world Sidebar-shaped source transforms without error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions