zed-industries/zed · error

ErasedEditorFactory to be initialized

Error message

ErasedEditorFactory to be initialized

What it means

RemoteConnectionPrompt::new expects ERASED_EDITOR_FACTORY (a global set by the UI layer at startup) to be initialized. It is None, meaning the modal was constructed before the editor factory global was registered — an initialization-order bug.

Source

Thrown at crates/remote_connection/src/remote_connection.rs:64

pub struct RemoteConnectionModal {
    pub prompt: Entity<RemoteConnectionPrompt>,
    paths: Vec<PathBuf>,
    finished: bool,
}

impl RemoteConnectionPrompt {
    pub fn new(
        connection_string: String,
        nickname: Option<String>,
        is_wsl: bool,
        is_devcontainer: bool,
        window: &mut Window,
        cx: &mut Context<Self>,
    ) -> Self {
        let editor_factory = ERASED_EDITOR_FACTORY
            .get()
            .expect("ErasedEditorFactory to be initialized");
        let editor = (editor_factory)(window, cx);

        Self {
            connection_string: connection_string.into(),
            nickname: nickname.map(|nickname| nickname.into()),
            is_wsl,
            is_devcontainer,
            editor,
            status_message: None,
            cancellation: None,
            prompt: None,
            prompt_cancellation_task: None,
            is_password_prompt: false,
            is_masked: true,
        }
    }

    pub fn set_cancellation_tx(&mut self, tx: oneshot::Sender<()>) {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Ensure editor UI init runs before any remote connection modal can open
  2. Guard construction and defer until the factory is available
  3. Panic message should note the missing init call for diagnosis
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/remote_connection/src/remote_connection.rs:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/10be762a7c189643. Report an issue: GitHub.