Skip to content

[Bug]: A sibling CSS import creates a false TypeScript self-import cycle #5652

Backlog

Description

@rvitaliy

On v0.9.124 (d249de367), a TSX component that imports its sibling stylesheet can appear to import itself. This puts a false one-file cycle ahead of real cycles when reviewing dependencies.

Reproduction

Run in an empty directory:

cat > button.tsx <<'TSX'
import './button.css';
export const Button = () => null;
TSX
echo '.button { color: red }' > button.css
cat > control.ts <<'TS'
import './control';
export const control = true;
TS
graphify extract . --code-only --no-cluster
graphify cycles --max-length 1

The output includes both button.tsx -> button.tsx and control.ts -> control.ts. Only the second is a TypeScript self-import. The stylesheet and the TSX module have distinct paths, so the import at line 1 of button.tsx should never point back to the component. The same symptom occurs with multiple components importing their own same-stem stylesheets in a React project.

Reproduced from source with a fresh graph on macOS arm64, CPython 3.14.10.

Activity

  1. github-actions commented on Nov 30, 2026

    @github-actions

    Thanks for opening this issue, @rvitaliy. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions