You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RStudio Desktop never starts when config.json is corrupt; the fallback error dialog throws "application not set" #19496
RStudio Edition : Desktop
RStudio Version : reported on 2025.09.2+418; same startup ordering on main (dd65ab2091)
OS Version : Ubuntu 24.10 and Fedora 43 reported; the code path is the same on all platforms
R Version : n/a
Steps to reproduce the problem
Quit RStudio Desktop.
Truncate the Electron settings file: : > ~/.config/RStudio/config.json (or write a few NUL bytes into it to mimic a crash or power loss mid-write).
Run rstudio from a terminal.
Describe the problem in detail
No window appears. The terminal prints:
[utils.ts] [createStandaloneErrorDialog] Error when creating Standalone Error Dialog: Error: application not set
Unexpected end of JSON input
(or Unexpected token '�', "�;9�M"... is not valid JSON for a zero-filled file).
DesktopOptionsImpl constructs its electron-store with only schema and no clearInvalidConfig (src/node/desktop/src/main/preferences/electron-desktop-options.ts), so conf rethrows the JSON SyntaxError from the constructor. That happens inside initializeRenderingEngine() in main.ts, which runs before setApplication(). The catch in RStudioMain.main() then calls createStandaloneErrorDialog, which needs appState().modalTracker (utils.ts), and appState() throws "application not set" because the singleton was never set. The user gets no dialog and the process exits. The only recovery users have found is deleting ~/.config/RStudio (and the sibling lowercase ~/.config/rstudio).
config.json is the store written most often (zoom level, window bounds on every close), so it is the one most likely to be truncated by a crash. By contrast r-environment.json already uses clearInvalidConfig: true and the macOS startup-state.json read is wrapped in try/catch.
A corrupt config.json should be moved aside (e.g. config.json.corrupt-<timestamp>) and RStudio should start with default desktop options, logging a warning. If startup does fail before the Application singleton exists, the standalone error dialog should still appear (fall back to a plain dialog.showMessageBox when appState() is unavailable), or setApplication() should run before anything that can throw.
Activity
recover from a corrupt desktop config.json instead of failing to start (