Skip to content

Conversation

@jacopone
Copy link
Owner

Summary

Adds missing system libraries to extraPkgs in the AppImage wrapper to fix native module loading issues on NixOS.

Problem

Without these libraries, Cursor fails with multiple errors:

Error: Cannot find module './build/Debug/keymapping'
TypeError: Cannot read properties of null (reading 'getCurrentKeyboardLayout')
TypeError: Cannot read properties of null (reading 'onDidChangeKeyboardLayout')
[BrowserViewMainService] Cannot execute JavaScript: browser view not created for window 1

Solution

Add the following libraries to the FHS environment:

Category Libraries
Keyboard/input libxkbfile, libxkbcommon
Security/credentials libsecret, nss, nspr
Graphics/GPU libGL, libdrm, mesa
GTK/display gtk3, glib, pango, cairo, gdk-pixbuf
Accessibility at-spi2-atk, at-spi2-core
Wayland wayland
System integration libnotify, cups, libpulseaudio, systemd
X11 libX11, libXcomposite, libXdamage, libXext, libXfixes, libXrandr, libxcb

Testing

  • Tested on NixOS with Cursor 2.2.43
  • All native-keymap errors resolved
  • Native modules load successfully: [CursorProclistService] Native module loaded successfully
  • Cursor runs stable with no recurring errors

Before/After

Before (vanilla 2.2.43):

Error: Cannot find module './build/Debug/keymapping'
TypeError: Cannot read properties of null (reading 'getCurrentKeyboardLayout')

After (with this fix):

[CursorProclistService] Native module loaded successfully
update#setState idle

🤖 Generated with Claude Code

Adds missing system libraries to extraPkgs to fix native module loading
issues on NixOS. Without these, Cursor fails with:

- native-keymap: Cannot find module './build/Debug/keymapping'
- TypeError: Cannot read properties of null (reading 'getCurrentKeyboardLayout')
- BrowserViewMainService: Cannot execute JavaScript

Libraries added:
- Keyboard/input: libxkbfile, libxkbcommon
- Security/credentials: libsecret, nss, nspr
- Graphics/GPU: libGL, libdrm, mesa
- GTK/display: gtk3, glib, pango, cairo, gdk-pixbuf
- Accessibility: at-spi2-atk, at-spi2-core (needed for BrowserView)
- Wayland support: wayland
- System integration: libnotify, cups, libpulseaudio, systemd
- X11 libraries: libX11, libXcomposite, libXdamage, libXext, libXfixes, libXrandr, libxcb

Tested on NixOS with Cursor 2.2.43 - all native-keymap errors resolved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jacopone jacopone merged commit 707a907 into main Dec 26, 2025
@jacopone jacopone deleted the fix/add-electron-native-libs branch December 26, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants