Skip to content

Browser dev startup crash on macOS: Cannot read properties of undefined (reading 'metadata') #75

@hook-ops

Description

@hook-ops

Environment

  • OS: macOS 14.6 (Darwin 23.6.0)
  • Device: Mac (Apple Silicon/Intel if known)
  • Node.js: v24.14.1
  • npm: 11.11.0
  • App run command: npm run tauri dev
  • Browser test URL: http://localhost:1420 and http://localhost:1420/welcome
  • Network: normal local dev network (no special proxy required for repro)

Summary

In browser dev mode on macOS, app initialization crashes with:
TypeError: Cannot read properties of undefined (reading 'metadata')
The app shows the "Failed to Initialize" fallback and becomes unusable in that context.

Steps To Reproduce

  1. Start Cortex IDE with npm run tauri dev.
  2. Open http://localhost:1420 in a regular browser tab on macOS.
  3. Observe startup.

Expected

Browser path should either:

  1. initialize safely, or
  2. show a graceful “Tauri runtime required” message without crashing core initialization.

Actual

Initialization fails and displays:

  • Failed to Initialize
  • The application could not load its core systems.
  • TypeError: Cannot read properties of undefined (reading 'metadata')

Code Evidence

  • Browser failure surfaces through initialization fallback UI:
    src/context/OptimizedProviders.tsx (ErrorFallback renders err.toString())
  • Window initialization depends on Tauri webview metadata:
    src/context/WindowsContext.tsx (getSafeCurrentWindowLabel() calls getCurrentWebviewWindow().label)
    src/context/WindowsContext.tsx (WindowsProvider computes isMainWindow from that label)
  • Auxiliary window path uses same label-resolution dependency:
Image
 src/context/WindowsContext.tsx (useAuxiliaryWindowInfo() fallback path)

Impact

Medium. Browser-based local testing path appears broken and blocks contributor/dev workflows.

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