atom / deprecation-cop

Shows a list of deprecated calls
MIT License
12 stars 19 forks source link

Uncaught TypeError: undefined is not a function #22

Closed AtzeDeVries closed 9 years ago

AtzeDeVries commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.174.0 System: linux 3.18.2-2-ARCH Thrown From: deprecation-cop package, v0.32.0

Stack Trace

Uncaught TypeError: undefined is not a function

At /usr/share/atom/resources/app/node_modules/deprecation-cop/node_modules/atom-selector-linter/lib/helpers.js:11

TypeError: undefined is not a function
  at module.exports.eachSelector (/usr/share/atom/resources/app/node_modules/deprecation-cop/node_modules/atom-selector-linter/lib/helpers.js:11:18)
  at SelectorLinter.module.exports.SelectorLinter.checkUIStylesheet (/usr/share/atom/resources/app/node_modules/deprecation-cop/node_modules/atom-selector-linter/lib/selector-linter.js:75:7)
  at SelectorLinter.module.exports.SelectorLinter.checkPackage (/usr/share/atom/resources/app/node_modules/deprecation-cop/node_modules/atom-selector-linter/lib/selector-linter.js:56:30)
  at Object.exports.getSelectorDeprecations (/usr/share/atom/resources/app/node_modules/deprecation-cop/lib/helpers.js:14:14)
  at exports.getSelectorDeprecationsCount (/usr/share/atom/resources/app/node_modules/deprecation-cop/lib/helpers.js:22:41)
  at DeprecationCopStatusBarView.module.exports.DeprecationCopStatusBarView.getDeprecatedSelectorCount (/usr/share/atom/resources/app/node_modules/deprecation-cop/lib/deprecation-cop-status-bar-view.js:70:115)
  at DeprecationCopStatusBarView.module.exports.DeprecationCopStatusBarView.update (/usr/share/atom/resources/app/node_modules/deprecation-cop/lib/deprecation-cop-status-bar-view.js:80:52)
  at /usr/share/atom/resources/app/node_modules/deprecation-cop/lib/deprecation-cop-status-bar-view.js:3:61
  at Object.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/emissary/lib/emitter.js:118:15)
  at global.__grim__.deprecate (/usr/share/atom/resources/app/node_modules/grim/lib/grim.js:70:21)
  at Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:55:11)
  at StatusBarSummaryView.render (/home/atze/.atom/packages/linter/lib/statusbar-summary-view.coffee:11:21)
  at LinterView.updateViews (/home/atze/.atom/packages/linter/lib/linter-view.coffee:193:27)
  at LinterView.display (/home/atze/.atom/packages/linter/lib/linter-view.coffee:189:6)
  at LinterView.processMessage (/home/atze/.atom/packages/linter/lib/linter-view.coffee:157:6)
  at LinterView.processMessage (/home/atze/.atom/packages/linter/lib/linter-view.coffee:1:1)
  at /home/atze/.atom/packages/linter/lib/linter-view.coffee:140:14
  at LinterRuby.Linter.processMessage (/home/atze/.atom/packages/linter/lib/linter.coffee:175:5)
  at /home/atze/.atom/packages/linter/lib/linter.coffee:150:8
  at BufferedProcess.triggerExitCallback (/usr/share/atom/resources/app/src/buffered-process.js:63:47)
  at /usr/share/atom/resources/app/src/buffered-process.js:70:18
  at Socket.<anonymous> (/usr/share/atom/resources/app/src/buffered-process.js:150:18)
  at Socket.emit (events.js:129:20)
  at Pipe.close (net.js:469:12)

Commands

     -0:18.8 application:open-folder (atom-text-editor.editor)
     -0:00.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-Oblivion.theme-polychrome-ui)

Config

{
  "core": {
    "disabledPackages": [
      "ruby-define-method"
    ],
    "themes": [
      "polychrome-ui",
      "Oblivion"
    ]
  }
}

Installed Packages

# User
Oblivion, v0.4.2
atomatigit, v1.2.3
github-issues, v0.3.0
language-asp, v0.1.0
language-aspx, v0.2.0
language-csharp, v0.3.0
language-powershell, v0.6.6
language-puppet, v0.10.0
linter, v0.10.0
linter-puppet-lint, v0.2.3
linter-ruby, v0.1.4
polychrome-ui, v0.2.4
ruby-strftime-reference, v0.2.0

# Dev
No dev packages

/cc @atom/core

maxbrunsfeld commented 9 years ago

This is weird; there's a stylesheet with the wrong type. Could you report the output of the following script in the console after this error happens?

packages = atom.packages.getLoadedPackages();
packageStylesheets = packages.map(function(pkg) { return pkg.stylesheets; });
stylesheetPairs = [].concat.apply([], packageStylesheets);
stylesheetPairs.filter(function(pair) { return typeof pair[1] !== "string"; });
AtzeDeVries commented 9 years ago

Hi

I found that the theme Polychrome is causing this issue. Using an other theme than is 'solves' the problem. Do you still want the output?

maxbrunsfeld commented 9 years ago

Yeah, it'd still be useful if you have a moment to run it. I don't think there's any problem with the polychrome theme, so I believe this is a bug in Atom.

kalevitan commented 9 years ago

I'm not using the Polychrome theme (Unity/Monokai) and I have the same error.

packages = atom.packages.getLoadedPackages(); packageStylesheets = packages.map(function(pkg) { return pkg.stylesheets; }); stylesheetPairs = [].concat.apply([], packageStylesheets); stylesheetPairs.filter(function(pair) { return typeof pair[1] !== "string"; }); [Array[2]0: "/Users/my_user/.atom/packages/script/stylesheets/script.less"1: Notificationlength: 2proto: Array[0]

mnpenner commented 9 years ago

This happens whenever I right-click the "Deprecation Cop" tab and try to "Split Right".