Uncaught TypeError: item.save is not a function
mhintz opened this issue · 7 comments
I'm gettin an undefined is not a function error all of a sudden
- Opened Atom after switching multirust to use the beta (instead of nightly) by default
- Attempted a cargo build using the Tokamak button
- The error shows up
Atom Version: 1.7.1
System: Mac OS X 10.10.5
Thrown From: tokamak package, v0.2.7
Stack Trace
Uncaught TypeError: item.save is not a function
At ~/.atom/packages/tokamak/lib/utils.coffee:96
TypeError: item.save is not a function
at ~/.atom/packages/tokamak/lib/utils.coffee:96:68
at Array.map (native)
at Function.module.exports.Utils.savePaneItems (~/.atom/packages/tokamak/lib/utils.coffee:96:35)
at atom-workspace.commandSubscription.atom.commands.add.tokamak:build (~/.atom/packages/tokamak/lib/cargo-view.coffee:29:15)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
at module.exports._executeCallback (~/.atom/packages/tool-bar/lib/tool-bar-button-view.coffee:71:23)
at space-pen-button.<anonymous> (~/.atom/packages/tool-bar/lib/tool-bar-button-view.coffee:30:7)
at space-pen-button.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at space-pen-button.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
Commands
2x -0:45 tokamak:multirust-select-toolchain (atom-text-editor.editor)
-0:40.1.0 tokamak:build (atom-text-editor.editor)
-0:32.4.0 pane:show-item-1 (atom-text-editor.editor.is-focused)
-0:31.5.0 core:save (atom-text-editor.editor.is-focused)
-0:31.1.0 pane:show-item-2 (atom-text-editor.editor.is-focused)
-0:30.7.0 core:save (atom-text-editor.editor.is-focused)
-0:29.7.0 find-and-replace:show (atom-text-editor.editor.is-focused)
-0:29 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:29 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:26.4.0 tokamak:build (atom-text-editor.editor)
-0:14.8.0 tokamak:clean (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
-0:12.9.0 tokamak:build (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
-0:10 tokamak:run (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
-0:00.7.0 tokamak:build (atom-text-editor.editor)
Have the same issue with Atom 1.6.2, Tokamak 0.2.7 on Fedora 23 x64 Linux.
same issue with atom 1.7.2, tokamak 0.2.7 on fedora 23 x64 and kde 5.5.
here following I attach you my log:
[Enter steps to reproduce below:]
- ...
- ...
Atom Version: 1.7.2
System: "Fedora release
Thrown From: tokamak package, v0.2.7
Stack Trace
Uncaught TypeError: item.save is not a function
At /home/marco/.atom/packages/tokamak/lib/utils.coffee:96
TypeError: item.save is not a function
at /home/marco/.atom/packages/tokamak/lib/utils.coffee:96:68
at Array.map (native)
at Function.module.exports.Utils.savePaneItems (/home/marco/.atom/packages/tokamak/lib/utils.coffee:96:35)
at atom-workspace.commandSubscription.atom.commands.add.tokamak:rebuild (/home/marco/.atom/packages/tokamak/lib/cargo-view.coffee:33:15)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app.asar/src/command-registry.js:160:19)
at module.exports._executeCallback (/home/marco/.atom/packages/tool-bar/lib/tool-bar-button-view.coffee:71:23)
at space-pen-button.<anonymous> (/home/marco/.atom/packages/tool-bar/lib/tool-bar-button-view.coffee:30:7)
at space-pen-button.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at space-pen-button.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
Commands
-0:00.6.0 tokamak:rebuild (button.btn.btn-default.icon.icon-link)
Config
{
"core": {
"themes": [
"atom-light-ui",
"one-dark-syntax"
]
},
"tokamak": {
"racerBinPath": "/home/marco/.cargo/bin/racer"
}
}
Installed Packages
# User
language-rust, v0.4.6
linter, v1.11.4
linter-rust, v0.4.5
racer, v0.20.0
tokamak, v0.2.7
tokamak-terminal, v0.1.1
tool-bar, v0.4.0
# Dev
No dev packages
It only seems to occur when the rust source code directory is not set correctly.
Once it is set, the error disappears and everything functions as normal... At least it did for me.
I am unable to start a new project because of this error. How do I get around it? How do I fix my projects?
About the rust source code updating probably #19 will overcome it. (@kevinpoitra can speak about that probably)
In any case I will pass a fix on that in next release.
What fixed it for me was disabling the auto detection of the binaries on startup. After setting the correct paths manually and restarting atom everything started working again.
Fixed in 0.2.8