Skip to content

bun run dev opens a hidden/invisible window on Windows — window works when bun --hot app.tsx is run directly #65

Description

@luchezarno

Summary

Running the example app via the documented bun run dev does not visibly open a window on Windows (x64). The process starts, logs [gpuix] created native window and
[gpuix] mount complete,
and renders fine — but the native window is created in a hidden state (IsWindowVisible returns false).
Launching the same app directly with bun --hot app.tsx (or bun app.tsx) shows the window correctly.

Environment

  • OS: Windows 10, x64 (Session 1, DWM running)
  • GPU: AMD Radeon(TM) Graphics (driver 27.20.14022.3003)
  • Bun: 1.4.0 (installed via Scoop)
  • GPU iX: @gpuix/react 0.7.0, @gpuix/native 0.7.0, @gpuix/native-win32-x64-msvc 0.7.0
  • App: the stock example-app (bunx @gpuix/cli new my-app)

How to reproduce

  bunx @gpuix/cli new my-app
  cd my-app
  bun run dev          # window does not appear

The process stays alive and prints:

  [gpuix] created native window
  [gpuix] mount complete

Enumerating top-level windows with EnumWindows while it runs shows the Todo window exists but is not visible:

  pid=24288 vis=False 'Todo'

If instead you run the script directly:

  bun --hot app.tsx    # window appears (vis=True)

the same window is visible (vis=True) with the correct 940×660 bounds and title Todo.

Suspected cause

The difference is process nesting introduced by the bun run wrapper.

With bun run dev, the app ends up launched 4 processes deep:

  bun.exe run dev  ->  bun.exe --hot app.tsx (shim)  ->  bun.exe --hot app.tsx (real app)

While direct bun --hot app.tsx runs only 2 deep. When the native GPUI window is created from a process launched deep inside the bun run wrapper chain, the window is created but never marked visible (IsWindowVisible == false).

I confirmed --hot is not the culprit: adding a plain script "devplain": "bun app.tsx" and running it via bun run devplain also produces a hidden window, whereas direct bun app.tsx is visible.

Notes / expectations

  • The rendered content mounts and the frame loop runs in both cases, so it is a window-visible/activation issue, not a GPU or render failure.
  • I also tried a minimal window without titlebarTransparent/windowBackground: 'blurred' and the behavior was identical.
  • Is this a known limitation of running GPUI windows from a Bun subprocess (bun run)? Is there anything the native window owner / activation logic could do to make the
    window visible regardless of how deep the launching process is nested?
  • Workarounds that work for me: run bun --hot app.tsx directly, or bun run build and run the compiled binary.

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