t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

When attempting insert with[i] stacktrace appears saying no underscore-plus found #999

Open drubenstein opened 6 years ago

drubenstein commented 6 years ago

[Enter steps to reproduce:]

  1. Open Atom
  2. Start new document
  3. Use the i key to insert text. The stacktrace appears. If an alphanumeric key is hit before the i then vim-mode-plus recognizes the i an insert and you can move forward.

Also note the underscore-plus1.6.6 package is installed and enabled

Atom: 1.22.1 x64 Electron: 1.6.15 OS: "Red Hat Thrown From: vim-mode-plus package 1.24.0

Stack Trace

Uncaught Error: Cannot find module 'underscore-plus'

At /home/users/XXXX/.atom/packages/atom-vim-mode-plus-1.24.0/lib/operation-stack.js:151

Error: Cannot find module 'underscore-plus'
    at Module._resolveFilename (module.js:470:15)
    at Module._resolveFilename (/usr/share/atom/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (/usr/share/atom/resources/app/src/module-cache.js:354:58)
    at Module.require (/app.asar/static/index.js:40:43)
    at require (/usr/share/atom/resources/app/src/native-compile-cache.js:66:33)
    at /packages/atom-vim-mode-plus-1.24.0/lib/pair-finder.js:9:35)
    at /packages/atom-vim-mode-plus-1.24.0/lib/pair-finder.js:281:3)
    at Module.get_Module._compile (/usr/share/atom/resources/app/src/native-compile-cache.js:106:36)
    at Object.value [as .js] (/usr/share/atom/resources/app/src/compile-cache.js:239:29)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/usr/share/atom/resources/app/src/native-compile-cache.js:66:33)
    at /packages/atom-vim-mode-plus-1.24.0/lib/text-object.js:9:20)
    at /packages/atom-vim-mode-plus-1.24.0/lib/text-object.js:876:2)
    at Module.get_Module._compile (/usr/share/atom/resources/app/src/native-compile-cache.js:106:36)
    at Object.value [as .js] (/usr/share/atom/resources/app/src/compile-cache.js:239:29)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/usr/share/atom/resources/app/src/native-compile-cache.js:66:33)
    at Function.getClass (/packages/atom-vim-mode-plus-1.24.0/lib/base.js:203:21)
    at Function.getInstance (/packages/atom-vim-mode-plus-1.24.0/lib/base.js:214:56)
    at ActivateInsertMode.getInstance (/packages/atom-vim-mode-plus-1.24.0/lib/base.js:86:29)
    at ActivateInsertMode.initialize (/packages/atom-vim-mode-plus-1.22.1/lib/operator.js:138:27)
    at Function.getInstance (/packages/atom-vim-mode-plus-1.24.0/lib/base.js:217:12)
    at OperationStack.run (/packages/atom-vim-mode-plus-1.24.0/lib/operation-stack.js:86:26)
    at /packages/atom-vim-mode-plus-1.24.0/lib/vim-state.js:67:45)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:381:36)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/usr/share/atom/resources/app/src/window-event-handler.js:3:65)

Commands

     -0:22 core:save (input.hidden-input)
     -0:16.9.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
     -0:15.8.0 vim-mode-plus:till-backwards (input.hidden-input)
     -0:15.5.0 vim-mode-plus:activate-insert-mode (input.hidden-input)
     -0:15.4.0 vim-mode-plus:substitute (input.hidden-input)
  8x -0:14.4.0 core:backspace (input.hidden-input)
     -0:09.4.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
  2x -0:09.2.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
  3x -0:08.7.0 vim-mode-plus:activate-insert-mode (input.hidden-input)
     -0:07.9.0 vim-mode-plus:move-right (input.hidden-input)
     -0:07.5.0 vim-mode-plus:insert-after (input.hidden-input)
     -0:07.4.0 vim-mode-plus:substitute (input.hidden-input)

Non-Core Packages

vim-mode-plus 1.24.0 
vim-mode-plus 1.24.0 

Check list

You have to check all before open issue.

t9md commented 6 years ago

@drubenstein

Let me ask some questions. Can you reproduce it always? Your Commands log bellow seem to not exactly how explained in repro steps. start atom then open empty buffer then i is enough repro steps?

-0:22 core:save (input.hidden-input)
-0:16.9.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
-0:15.8.0 vim-mode-plus:till-backwards (input.hidden-input)
-0:15.5.0 vim-mode-plus:activate-insert-mode (input.hidden-input)
-0:15.4.0 vim-mode-plus:substitute (input.hidden-input)
8x -0:14.4.0 core:backspace (input.hidden-input)
-0:09.4.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
2x -0:09.2.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
3x -0:08.7.0 vim-mode-plus:activate-insert-mode (input.hidden-input)
-0:07.9.0 vim-mode-plus:move-right (input.hidden-input)
-0:07.5.0 vim-mode-plus:insert-after (input.hidden-input)
-0:07.4.0 vim-mode-plus:substitute (input.hidden-input)

Btw I couldn't reproduce it. Maybe because I'm macOS user. Even if it's bug, I still can't understand what kind of bug affect module loading? Can you investigate how Atom recognize your first i, by

drubenstein commented 6 years ago

vim-mode-plus:activate-insert-mode atom-test-editor-vim-mode-plus.normal-mode /home/users/XXXX/.atom/packages/atom-vim-mode-plus-1.24.0/keymaps-mode-plus.cson

hobbes3 commented 6 months ago

I also got the same problem on Windows 11 as soon as I hit i or a to get into insert mode. Maybe because I didn't use the apm package installer (seems no longer available?), but manually unzipped the downloaded files into Atom's packages folder?

Uncaught Error: Cannot find module 'underscore-plus' Require stack:

C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\pair-finder.js
C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\text-object.js
C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\base.js
C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\operation-stack.js
C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\vim-state.js
C:\Users\hobbes3.atom\packages\atom-vim-mode-plus-master\lib\main.js
C:\Programs\Atom\resources\app.asar\static\index.html

C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\operation-stack.js:164
[Hide Stack Trace](https://github.com/t9md/atom-vim-mode-plus/issues/999#)
Error: Cannot find module 'underscore-plus'
Require stack:
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\pair-finder.js
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\text-object.js
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\base.js
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\operation-stack.js
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\vim-state.js
- C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\main.js
- C:\Programs\Atom\resources\app.asar\static\index.html
    at Module._resolveFilename (internal/modules/cjs/loader.js:797:17)
    at o._resolveFilename (electron/js2c/renderer_init.js:43:689)
    at Function.get_Module._resolveFilename (C:\Programs\Atom\resources\app\static\<embedded>:11:157942)
    at Module.require (file:///C:/Programs/Atom/resources/app.asar/static/index.js:61:43)
    at require (C:\Programs\Atom\resources\app\static\<embedded>:11:149229)
    at Object.<anonymous> (C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\pair-finder.js:4:35)
    at Object.<anonymous> (C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\pair-finder.js:276:3)
    at Module.get_Module._compile (C:\Programs\Atom\resources\app\static\<embedded>:11:149913)
    at Object.value [as .js] (C:\Programs\Atom\resources\app\static\<embedded>:11:153507)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (file:///C:/Programs/Atom/resources/app.asar/static/index.js:72:46)
    at require (C:\Programs\Atom\resources\app\static\<embedded>:11:149229)
    at Object.<anonymous> (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/text-object.js:9:20)
    at Object.<anonymous> (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/text-object.js:1013:2)
    at Module.get_Module._compile (C:\Programs\Atom\resources\app\static\<embedded>:11:149913)
    at Object.value [as .js] (C:\Programs\Atom\resources\app\static\<embedded>:11:153507)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (file:///C:/Programs/Atom/resources/app.asar/static/index.js:72:46)
    at require (C:\Programs\Atom\resources\app\static\<embedded>:11:149229)
    at Function.getClass (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/base.js:209:21)
    at Function.getInstance (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/base.js:224:56)
    at InsertAfter.getInstance (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/base.js:92:29)
    at InsertAfter.initialize (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/operator.js:139:27)
    at InsertAfter.initialize (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/operator-insert.js:10:29)
    at Function.getInstance (file:///C:/Users/hobbes3/.atom/packages/atom-vim-mode-plus-master/lib/base.js:227:12)
    at OperationStack.run (C:\Users\hobbes3\.atom\packages\atom-vim-mode-plus-master\lib\operation-stack.js:95:26)

The error was thrown from the [vim-mode-plus package](https://github.com/t9md/atom-vim-mode-plus).