Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: undefined is not a function #456

Closed
lycarter opened this issue Mar 3, 2015 · 20 comments
Closed

Uncaught TypeError: undefined is not a function #456

lycarter opened this issue Mar 3, 2015 · 20 comments

Comments

@lycarter
Copy link

lycarter commented Mar 3, 2015

[Enter steps to reproduce below:]

  1. open new file
  2. save new file
    (possibly only occurs in conjunction with remote-sync package)

Atom Version: 0.165.0
System: linux 3.13.0-32-generic
Thrown From: linter package, v0.10.1

Stack Trace

Uncaught TypeError: undefined is not a function

At /usr/share/atom/resources/app/src/workspace.js:614

TypeError: undefined is not a function
  at LinterJshint.Linter (/home/lcarter/.atom/packages/linter/lib/linter.coffee:54:33)
  at new LinterJshint (/home/lcarter/.atom/packages/linter-jshint/lib/linter-jshint.coffee:28:5)
  at LinterView.initLinters (/home/lcarter/.atom/packages/linter/lib/linter-view.coffee:51:27)
  at /home/lcarter/.atom/packages/linter/lib/linter-view.coffee:95:8
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.handleGrammarChange (/usr/share/atom/resources/app/src/text-editor.js:2736:27)
  at /usr/share/atom/resources/app/src/text-editor.js:196:24
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TokenizedBuffer.module.exports.TokenizedBuffer.setGrammar (/usr/share/atom/resources/app/src/tokenized-buffer.js:164:27)
  at TokenizedBuffer.module.exports.TokenizedBuffer.reloadGrammar (/usr/share/atom/resources/app/src/tokenized-buffer.js:170:21)
  at /usr/share/atom/resources/app/src/tokenized-buffer.js:62:24
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextBuffer.module.exports.TextBuffer.setPath (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:281:20)
  at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:965:12)
  at TextEditor.module.exports.TextEditor.saveAs (/usr/share/atom/resources/app/src/text-editor.js:589:26)
  at Pane.module.exports.Pane.saveItemAs (/usr/share/atom/resources/app/src/pane.js:527:14)
  at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app/src/pane.js:515:21)
  at Pane.module.exports.Pane.saveActiveItem (/usr/share/atom/resources/app/src/pane.js:501:19)
  at Workspace.module.exports.Workspace.saveActivePaneItemAndReportErrors (/usr/share/atom/resources/app/src/workspace.js:603:44)
  at Workspace.module.exports.Workspace.saveActivePaneItem (/usr/share/atom/resources/app/src/workspace.js:593:19)
  at atom-workspace.atom.commands.add.core:save (/usr/share/atom/resources/app/src/workspace-element.js:295:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:167:20)

Commands

     -0:42.3 pane:show-previous-item (ul.list-inline.tab-bar.inset-panel)
     -0:41.4 pane:show-next-item (input.hidden-input)
     -0:38.3 core:select-all (input.hidden-input)
     -0:32.4 core:backspace (input.hidden-input)
     -0:32.3 core:save (input.hidden-input)
     -0:27.2 core:select-all (input.hidden-input)
     -0:26.8 core:copy (input.hidden-input)
 15x -0:17.0 core:backspace (input.hidden-input)
     -0:10.0 core:confirm (input.hidden-input)
     -0:00.7 application:new-file (input.hidden-input)
     -0:00.0 core:save (input.hidden-input)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ],
    "disabledPackages": [
      "atom-color-highlight"
    ]
  },
  "linter": {}
}

Installed Packages

# User
autocomplete-paths, v0.9.1
autocomplete-plus, v1.1.0
autocomplete-snippets, v0.3.2
color-picker, v1.4.4
editor-stats, v0.16.0
linter, v0.10.1
linter-csslint, v0.0.11
linter-jshint, v0.1.0
linter-php, v0.0.11
linter-pylint, v0.2.0
minimap, v3.5.6
minimap-color-highlight, v3.1.0
minimap-git-diff, v3.1.0
remote-sync, v2.4.0
seti-syntax, v0.2.1
seti-ui, v0.6.1

# Dev
No dev packages

/cc @atom/core

@zensh
Copy link

zensh commented Aug 17, 2015

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.5
System: Mac OS X 10.10.5
Thrown From: linter package, v1.4.1

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/zensh/.atom/packages/linter/lib/linter.coffee:106

TypeError: undefined is not a function
  at /Users/zensh/.atom/packages/linter/lib/linter.coffee:106:8
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at /Users/zensh/.atom/packages/linter/lib/editor-linter.coffee:10:16
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.destroyed (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:273:27)
  at TextEditor.module.exports.Model.destroy (/Applications/Atom.app/Contents/Resources/app.asar/src/model.js:45:58)
  at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:460:18)
  at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:236:22)
  at space-pen-ul.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
  at space-pen-ul.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "keybinding-resolver",
      "auto-update-packages",
      "linter-jshint"
    ],
    "themes": [
      "atom-dark-ui",
      "monokai"
    ]
  },
  "linter": {
    "lintOnChange": true,
    "lintOnEditorFocus": false,
    "showErrorPanel": false,
    "showErrorTabProject": false,
    "lintOnFly": false,
    "showErrorTabFile": false
  }
}

Installed Packages

# User
atom-beautify, v0.28.11
atom-typescript, v5.4.0
language-dart, v0.2.0
language-ejs, v0.2.0
language-haskell, v1.3.1
language-jade, v0.6.2
language-javascript-jsx, v0.3.7
language-lua, v0.9.4
language-rust, v0.4.4
linter, v1.4.1
linter-csslint, v1.0.5
linter-hlint, v0.4.2
linter-js-standard, v2.4.0
linter-lua, v1.0.0
linter-rust, v0.2.7
monokai, v0.18.0
trailing-spaces, v0.3.2

# Dev
No dev packages

@steelbrain
Copy link
Owner

@zensh I pushed a fix for it minutes after publishing it. You should see another available update now.

@zensh
Copy link

zensh commented Aug 17, 2015

thank you

@jdicioccio
Copy link

[Enter steps to reproduce below:]

  1. Linter: Toggle

Atom Version: 1.0.7
System: Mac OS X 10.10.5
Thrown From: linter package, v1.4.1

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/jd/.atom/packages/linter/lib/editor-linter.coffee:39

TypeError: undefined is not a function
  at EditorLinter.destroy (/Users/jd/.atom/packages/linter/lib/editor-linter.coffee:39:6)
  at Commands.toggleLinter (/Users/jd/.atom/packages/linter/lib/commands.coffee:26:20)
  at atom-workspace.Commands.subscriptions.add.atom.commands.add.linter:toggle (/Users/jd/.atom/packages/linter/lib/commands.coffee:9:28)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
  at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

     -0:17.1.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:16.2.0 core:save (atom-text-editor.editor.is-focused)
     -0:13.4.0 grammar-selector:show (atom-text-editor.editor)
     -0:09.4.0 linter:next-error (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -0:06.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:04.7.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:04.2.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -0:03.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:03.6.0 linter:lint (atom-text-editor.editor)
     -0:02.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:01.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:00.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:00.7.0 linter:toggle (atom-text-editor.editor)

Config

{
  "core": {},
  "linter": {}
}

Installed Packages

# User
language-rust, v0.4.4
linter, v1.4.1
linter-rust, v0.2.7
racer, v0.17.1

# Dev
No dev packages

@steelbrain
Copy link
Owner

@jdicioccio fixed via #841

@kieranklaassen
Copy link

  1. When saving a .rb page

Atom Version: 1.0.7
System: Mac OS X 10.10.5
Thrown From: linter package, v1.4.3

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/kieranklaassen/.atom/packages/linter/lib/ui/message-element.js:87

TypeError: undefined is not a function
  at Function.getMessage (/Users/kieranklaassen/.atom/packages/linter/lib/ui/message-element.js:87:115)
  at linter-message.attachedCallback (/Users/kieranklaassen/.atom/packages/linter/lib/ui/message-element.js:46:32)
  at OverlayManager.module.exports.OverlayManager.renderOverlay (/Applications/Atom.app/Contents/Resources/app.asar/src/overlay-manager.js:77:21)
  at OverlayManager.module.exports.OverlayManager.render (/Applications/Atom.app/Contents/Resources/app.asar/src/overlay-manager.js:17:16)
  at TextEditorComponent.module.exports.TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:226:15)
  at TextEditorComponent.module.exports.TextEditorComponent.becameVisible (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:278:21)
  at TextEditorComponent.module.exports.TextEditorComponent.checkForVisibilityChange (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:815:16)
  at atom-text-editor.TextEditorElement.attachedCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:98:22)
  at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:150:24)
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:242:22)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:306:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:489:16
  at _fulfilled (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:794:54)
  at self.promiseDispatch.done (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:823:30)
  at Promise.promise.promiseDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:756:13)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:564:44
  at flush (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:110:17)
  at process._tickCallback (node.js:357:13)

Commands

     -0:13.8.0 fuzzy-finder:toggle-file-finder (atom-pane.pane.active)
     -0:10.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:05.9.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:02.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "railscast-theme"
    ],
    "disabledPackages": [
      "language-coffee-script-angular"
    ]
  },
  "linter": {
    "ignoredLinterErrors": [
      "scss-lint"
    ],
    "lintOnFly": false
  }
}

Installed Packages

# User
aligner-ruby, v1.4.0
aligner-scss, v1.0.2
atom-beautify, v0.28.11
color-picker, v2.0.11
coverage, v0.6.1
file-icons, v1.6.6
html2haml, v0.10.0
language-haml, v0.21.0
linter, v1.4.3
linter-coffeelint, v1.0.2
linter-haml, v1.0.0
linter-reek, v2.0.0
linter-rubocop, v0.3.2
linter-ruby, v1.0.2
linter-scss-lint, v2.0.0
minimap, v4.13.0
minimap-color-highlight, v4.1.4
minimap-find-and-replace, v4.3.0
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.0
minimap-pigments, v0.1.5
pigments, v0.11.0
railscast-theme, v0.3.0
wercker-status, v1.0.5

# Dev
No dev packages

@dylanpinn
Copy link

I am also getting the same error when saving a .rb file.

Let me know if you need a Stack Trace.

@steelbrain
Copy link
Owner

@dylanpinn a trace would be appreciated. A repro case would be Great.

@dylanpinn
Copy link

  1. Save a .rb file

Atom Version: 1.0.7
System: Ubuntu 15.04
Thrown From: linter package, v1.4.3

Stack Trace

Uncaught TypeError: undefined is not a function

At /home/dylan/.atom/packages/linter/lib/ui/message-element.js:87

TypeError: undefined is not a function
  at Function.getMessage (/home/dylan/.atom/packages/linter/lib/ui/message-element.js:87:115)
  at linter-message.attachedCallback (/home/dylan/.atom/packages/linter/lib/ui/message-element.js:46:32)
  at BottomPanel.setMessages (/home/dylan/.atom/packages/linter/lib/ui/bottom-panel.js:55:22)
  at LinterViews.render (/home/dylan/.atom/packages/linter/lib/linter-views.coffee:41:12)
  at /home/dylan/.atom/packages/linter/lib/linter.coffee:30:14
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at MessageRegistry.updatePublic (/home/dylan/.atom/packages/linter/lib/message-registry.js:108:20)
  at UpdateMessages (/home/dylan/.atom/packages/linter/lib/message-registry.js:35:17)

Commands

Config

{
  "core": {
    "followSymlinks": false,
    "disabledPackages": [
      "starred-package-installer",
      "linter-jsxhint",
      "linter-js-standard",
      "linter-erb"
    ]
  },
  "linter": {
    "showErrorPanel": false
  }
}

Installed Packages

# User
angularjs, v0.3.0
atom-zeal, v0.1.3
autocomplete-paths, v1.0.2
color-picker, v2.0.11
docblockr, v0.7.3
editorconfig, v1.0.1
emmet, v2.3.12
file-icons, v1.6.6
language-docker, v1.1.3
language-gitignore, v0.2.0
language-haml, v0.21.0
language-htaccess, v0.1.1
language-html-swig, v2.0.1
language-nginx, v0.5.4
language-nunjucks, v2.0.0
language-slim, v0.5.0
linter, v1.4.3
linter-bootlint, v0.0.6
linter-csslint, v1.0.5
linter-eslint, v3.0.2
linter-haml, v1.0.0
linter-handlebars, v2.1.0
linter-htmlhint, v0.1.1
linter-js-yaml, v1.1.1
linter-jscs, v2.0.4
linter-jshint, v1.1.5
linter-php, v1.0.3
linter-phpcs, v1.0.6
linter-phpmd, v1.0.0
linter-reek, v2.0.0
linter-rubocop, v0.3.2
linter-scss-lint, v2.0.0
linter-slim, v1.0.0
linter-tidy, v1.0.1
linter-xmllint, v0.0.7
minimap, v4.13.0
minimap-linter, v1.0.0
pigments, v0.11.0
project-manager, v1.15.11
react, v0.12.6

# Dev
No dev packages

@steelbrain
Copy link
Owner

@dylanpinn it's quite unclear where the error is in that file as the trace becomes invalid after transpilation, Can you search in ~/.atom/compile-cache/js/*/* for a file which contains linter-message-element and post it's contents?

@dylanpinn
Copy link

That string does not show up in any of those files.

On 21 August 2015 at 11:25, Steel Brain [email protected] wrote:

@dylanpinn https://github.com/dylanpinn it's quite unclear where the
error is in that file as the trace becomes invalid after transpilation, Can
you search in ~/.atom/compile-cache/js// for a file which contains
linter-message-element and post it's contents?


Reply to this email directly or view it on GitHub
#456 (comment)
.

Dylan Pinn
Developer
Arcadian Digital

web: www.arcadiandigital.com.au
ph: 1300 885 726
mob: 0415 451 703
email: [email protected]
office: Suite 1 Level 6, 443 Little Collins Street, Melbourne 3000

@steelbrain
Copy link
Owner

@dylanpinn How about linter-message?

@dylanpinn
Copy link

@steelbrain
Copy link
Owner

I think I know what the problem is, however can you hook a console.log(arguments) in start of Message::getMessage and repro the error and post what the arguments were?

@dylanpinn
Copy link

Where file is that located in?

On 21 August 2015 at 11:37, Steel Brain [email protected] wrote:

I think I know what the problem is, however can you hook a
console.log(arguments) in start of Message::getMessage and repro the
error and post what the arguments were?


Reply to this email directly or view it on GitHub
#456 (comment)
.

Dylan Pinn
Developer
Arcadian Digital

web: www.arcadiandigital.com.au
ph: 1300 885 726
mob: 0415 451 703
email: [email protected]
office: Suite 1 Level 6, 443 Little Collins Street, Melbourne 3000

@dylanpinn
Copy link

This is what I get if I console.log(arguments) on line 63.

[Object]0: Objectclass: "warning"currentFile: truecurrentLine: truefilePath: "/home/dylan/dev/rails/machineparts/app/models/concerns/product_synchronizer.rb"key: "{"type":"warning","text":["ClassMethods#update_machines performs a nil-check (NilCheck)\n",""],"filePath":"/home/dylan/dev/rails/machineparts/app/models/concerns/product_synchronizer.rb","range":{"start":{"row":0,"column":0},"end":{"row":0,"column":0}}}"range: Rangeend: Pointcolumn: 0row: 0__proto__: Pointstart: Pointcolumn: 0row: 0__proto__: Point__proto__: Rangetext: Array[2]0: "ClassMethods#update_machines performs a nil-check (NilCheck)"1: ""length: 2__proto__: Array[0]type: "warning"__proto__: Objectcallee: function getMessage(message) {length: 1Symbol(Symbol.iterator): function ArrayValues() { [native code] }__proto__: Object

@mttrs
Copy link

mttrs commented Aug 26, 2015

Still getting the same error as @dylanpinn, so the lint doesn't work well. Any reason why this issue status is closed?

OS X: 10.10.5
atom: 1.0.7
Version: 1.4.3

@Arcanemagus
Copy link
Collaborator

It was closed because the original issue was fixed back with the complete re-write. When it was posted to 10 days ago the person commented on an old issue with a new issue instead of filing a new one.

It looks like several of you are actually hitting a bug in linter-reek (AtomLinter/linter-reek#11) in which it is passing invalid messages to linter (Thus triggering a further bug in linter in that it doesn't handle the bad messages properly, which is what is triggering the message you are seeing).

For the few of you seeing this that don't have that installed I would guess that linter-rust has a similar issue as it is the only commonality between you.

@steelbrain
Copy link
Owner

The passing invalid messages issue will be reported by the upcoming version, See #868

@mttrs
Copy link

mttrs commented Aug 27, 2015

@Arcanemagus and @steelbrain ,
Checked the #868 and AtomLinter/linter-reek#11. Thank you for the information and am looking forward to the upcoming version! For the work around, I just disabled linter-reek.

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

No branches or pull requests

10 participants