NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.1k stars 14.15k forks source link

cursor: MODULE_NOT_FOUND error #343229

Closed luochen1990 closed 1 month ago

luochen1990 commented 1 month ago

Describe the bug

  1. A new installation of cursor report MODULE_NOT_FOUND error
  2. Vim mode cannot be enabled, no such option (not sure if 1 is the reason)
  3. Vim plugin from vscode should be auto enabled by cursor but also not working. (not sure if 1 is the reason)

Steps To Reproduce

Steps to reproduce the behavior:

  1. new installation of cursor
  2. import config from vscode (which has vim plugin enabled).
  3. use cursor . to open a directory in terminal
  4. the error message printed

Expected behavior

No error message, and vim mode works correctly.

Screenshots

image

Notify maintainers

@sarahec

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"

- system: `"x86_64-linux"`
- host os: `Linux 6.10.9-zen1, NixOS, 24.11 (Vicuna), 24.11.20240914.6ca042d`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.6`
- nixpkgs: `/nix/store/cjz8w4dgc3rd2n3dqv5c208vygndjyba-source`

Add a :+1: reaction to issues you find important.

sarahec commented 1 month ago

Which desktop environment are you using (e.g. KDE, GNOME, ...)?

sarahec commented 1 month ago

Please also post a copy of this in https://forum.cursor.com

Here's the challenge:

  1. Cursor comes packaged as an AppImage (which is supposed to contain all the libraries it needs). It may be something only they can fix.
  2. I haven't been able to reproduce the bug (using KDE).
  3. I can't find any similar reports in cursor's forum.

I'll keep looking. Could you share a copy of the configuration you imported?

sarahec commented 1 month ago

A few more questions:

  1. Which Vim plugin are you using? (The most downloaded one Vim 1.28.1 has the identifier vscodevim.vim.
  2. What feature isn't working in Vim?
  3. When you click on the gear icon next to the extension's name, is there any error message there?

When I try it, I see a slightly different set of error messages but the editor still works. I suspect, as you do, that something about the vim extension is triggering the issue.

P.S. Do either of these look like your bug? 1.https://forum.cursor.com/t/cmd-k-is-unusable-when-undoing-using-vim/13253

  1. https://forum.cursor.com/t/vim-mode-holding-a-key-to-repeat-increases-lag-the-longer-cursor-is-open/7038
sarahec commented 1 month ago

This may be covered by the 0.41.1 update that just released. I've filed a pull request to update it, and now we wait for a reviewer.

Giving the PR a thumbs up in the description may get attention on it sooner.

PR #343360

luochen1990 commented 1 month ago

@sarahec Thanks for your reply.

Which Vim plugin are you using?

I find out that my vim plugin is not installed automatically. I manually installed it and now it works well, although the error messages reported in the issue description still exists.

I'm new to cursor and I'm telled all my extensions in vscode are ported to cursor, and some of them (such as python) did work, so I think the vim plugins is also installed but not working, but I'm wrong, I find out that there are many plugins not installed automatically, such as vim, nix and haskell plugins. I'm not sure why, and how cursor configure itself with my vscode configuration confused me, maybe that's because I have run cursor once before a year ago?

Which desktop environment are you using (e.g. KDE, GNOME, ...)?

I'm using Plasma6 as DE, with x11 as display server.

Could you share a copy of the configuration you imported?

I still don't know how to export my cursor configuration, and what's the relationship between my cursor configuration and my vscode configuration (a copy or a reference? ). If I'm telled how, I will be happy to paste it here if it is still useful.

sarahec commented 1 month ago

I'll need to do some testing to answer your question.

0.41.1 was merged last night but isn't quite ready. status

Michael-J-Ward commented 1 month ago

v0.41.1 does not appear to fix the problem.

@todesktop/runtime: skipping autoUpdater initialization because application is not in AppImage.
Warning: 'update' is not in the list of known options, but still passed to Electron/Chromium.
[main 2024-09-24T20:52:39.774Z] update#setState disabled
[main 2024-09-24T20:52:39.775Z] update#ctor - updates are disabled as there is no update URL
Error: Cannot find module './build/Debug/keymapping'
Require stack:
- /nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js
- /nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at s._resolveFilename (node:electron/js2c/browser_init:2:115690)
    at Module._load (node:internal/modules/cjs/loader:908:27)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at R (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/main.js:5:647)
    at NativeBinding._init (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:19:24)
    at NativeBinding.getKeyMap (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:24:10)
    at exports.getKeyMap (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:63:18)
    at b (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/vs/code/electron-main/main.js:116:27178)
    at I.g (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/vs/code/electron-main/main.js:116:26976) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js',
    '/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/main.js',
    undefined
  ]
}
TypeError: Cannot read properties of null (reading 'getCurrentKeyboardLayout')
    at NativeBinding.getCurrentKeyboardLayout (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:34:29)
    at exports.getCurrentKeyboardLayout (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:60:18)
    at b (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/vs/code/electron-main/main.js:116:27194)
    at I.g (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/vs/code/electron-main/main.js:116:26976)
TypeError: Cannot read properties of null (reading 'onDidChangeKeyboardLayout')
    at NativeBinding.onDidChangeKeyboardLayout (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:43:22)
    at exports.onDidChangeKeyboardLayout (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/node_modules.asar/native-keymap/index.js:66:18)
    at I.g (/nix/store/kplycmipn4fc9f48jhylmadxdnl18jr0-cursor-0.41.1-extracted/resources/app/out/vs/code/electron-main/main.js:116:26989)
[main 2024-09-24T20:52:39.843Z] [storage state.vscdb] error checking size of src.vs.platform.reactivestorage.browser.reactiveStorageServiceImpl.persistentStorage.workspaceUser: Error: Unexpected number of rows - 0
[main 2024-09-24T20:52:39.845Z] [storage state.vscdb] error checking size of workbench.panel.aichat.view.aichat.chatdata: Error: Unexpected number of rows - 0

Env Info

❯ nix run nixpkgs#"nix-info" -- -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.6, NixOS, 24.11 (Vicuna), 24.11.20240921.9357f4f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.7`
 - channels(root): `"nixos-21.11.337834.ca6a296d570"`
 - channels(mike): `""`
 - nixpkgs: `/nix/store/ia1zpg1s63v6b3vin3n7bxxjgcs51s2r-source`

❯ env | grep DESKTOP
DESKTOP_SESSION=plasma
XDG_SESSION_DESKTOP=KDE
XDG_CURRENT_DESKTOP=KDE
NIX_XDG_DESKTOP_PORTAL_DIR=/run/current-system/sw/share/xdg-desktop-portal/portals
sarahec commented 1 month ago

The same problem is happening on their MacOS download. It's nothing I can affect.

If it's causing you problems, it should be reported on their forum.

Thanks for hanging in there with me.