gepoch / vim-surround

Surround for the Atom editor.
MIT License
52 stars 2 forks source link

Failed to activate the vim-surround package #15

Closed protoiyer closed 9 years ago

protoiyer commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.190.0 System: Mac OS X 10.10.3 Thrown From: vim-surround package, v0.5.0

Stack Trace

Failed to activate the vim-surround package

At Cannot read property 'length' of undefined

TypeError: Cannot read property 'length' of undefined
  at /Users/suresh.iyer/.atom/packages/vim-surround/lib/surround.coffee:27:14
  at Surround.registerPairs (/Users/suresh.iyer/.atom/packages/vim-surround/lib/surround.coffee:52:9)
  at /Users/suresh.iyer/.atom/packages/vim-surround/lib/surround.coffee:1:1
  at Config.module.exports.Config.observeKeyPath (/Applications/Atom.app/Contents/Resources/app/src/config.js:544:7)
  at Config.module.exports.Config.observe (/Applications/Atom.app/Contents/Resources/app/src/config.js:126:21)
  at Surround.activate (/Users/suresh.iyer/.atom/packages/vim-surround/lib/surround.coffee:16:17)
  at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:225:19)
  at /Applications/Atom.app/Contents/Resources/app/src/package.js:206:30
  at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:152:15)
  at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:199:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:435:21)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:268:29
  at exit (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:43:16)
  at BufferedProcess.triggerExitCallback (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:63:47)
  at /Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:70:18
  at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:150:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:166:7)
  at Pipe.close (net.js:464:12)

Commands

     -30:48.7 settings-view:open (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
vim-surround, v0.5.0

# Dev
No dev packages
gepoch commented 9 years ago

Hmm.. Do you have a trailing comma in the settings for the surround module, possibly?

Anyways, I've release 0.5.1 to cover for the possible issue that may be causing this. Let me know how it works for you!

protoiyer commented 9 years ago

I didn't make any changes to the settings, @gepoch. I will try uninstalling and reinstalling.

gepoch commented 9 years ago

Did 0.5.1 fix things for you?

protoiyer commented 9 years ago

Yes, it did. I just uninstalled 0.5.0 and installed 0.5.1. I haven't tested the surround features yet. Will report back in case there are any issues. Thanks.

On Tue, Apr 14, 2015 at 8:44 PM, George Marchin notifications@github.com wrote:

Did 0.5.1 fix things for you?

— Reply to this email directly or view it on GitHub https://github.com/gepoch/vim-surround/issues/15#issuecomment-92899027.

Suresh Iyer

+91-98402-78798 | protoiyer@gmail.com

In the long run men hit only what they aim at - Henry David Thoreau

shemerey commented 9 years ago

New problems with latest Atom

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.206.0 System: Mac OS X 10.10.3 Thrown From: vim-surround package, v0.6.0

Stack Trace

Failed to activate the vim-surround package

At Cannot read property 'add' of undefined

TypeError: Cannot read property 'add' of undefined
    at Surround.module.exports.Base.createPairBindings (/Users/zork/.atom/packages/vim-surround/lib/command/base.coffee:66:46)
    at Surround.module.exports.Base.registerPair (/Users/zork/.atom/packages/vim-surround/lib/command/base.coffee:44:14)
    at Surround.module.exports.Base.registerPairs (/Users/zork/.atom/packages/vim-surround/lib/command/base.coffee:31:16)
    at Surround.Base (/Users/zork/.atom/packages/vim-surround/lib/command/base.coffee:11:12)
    at new Surround (/Users/zork/.atom/packages/vim-surround/lib/command/surround.coffee:16:38)
    at /Users/zork/.atom/packages/vim-surround/lib/vim-surround.coffee:36:23
    at Config.module.exports.Config.observeKeyPath (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:555:7)
    at Config.module.exports.Config.observe (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:135:21)
    at Object.module.exports.activate (/Users/zork/.atom/packages/vim-surround/lib/vim-surround.coffee:24:44)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)

Commands

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "tomorrow-night-eighties-syntax"
    ],
    "disabledPackages": [
      "atom-ctags",
      "file-type-icons",
      "tabs",
      "tree-view"
    ]
  },
  "vim-surround": {}
}

Installed Packages

# User
file-icons, v1.5.7
language-viml, v0.2.0
project-manager, v1.15.8
rspec-snippets, v0.4.0
tomorrow-night-eighties-syntax, v0.6.1
vim-mode, v0.51.0
vim-surround, v0.6.0

# Dev
No dev packages
gepoch commented 9 years ago

Indeed. Seems to have broken at 206.

I'll try to get a fix out this morning. Thanks for the bug report.

jtheoof commented 8 years ago

This issue resurfaced for me today, after upgrade to atom 1.9.

Failed to activate the vim-surround package: Cannot find module 'undefined/lib/text-objects'

Error: Cannot find module 'undefined/lib/text-objects'
    at Module._resolveFilename (module.js:339:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/jattali/.atom/packages/vim-surround/lib/command/selector.coffee:4:46)
    at Object.<anonymous> (/Users/jattali/.atom/packages/vim-surround/lib/command/selector.coffee:1:1)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/jattali/.atom/packages/vim-surround/lib/command/delete.coffee:4:12)
    at Object.<anonymous> (/Users/jattali/.atom/packages/vim-surround/lib/command/delete.coffee:1:1)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
jeffling commented 7 years ago

disregard, i am silly

gepoch commented 7 years ago

@jeffling You're using vim-mode-plus. vim-mode-plus implements its own surround commands, so vim-surround isn't necessary! There's a bit of up-front configuration, but it works great. See here for an example keymap setup: https://github.com/t9md/dotfiles/blob/master/atom/keymap.cson#L208

edit: And if it wasn't clear, this means you should uninstall vim-surround :)

jeffling commented 7 years ago

Thank you, @gepoch.