Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Uncaught Error: The workspace can only contain one instance of item [object Object] #113

Closed
shixukai opened this issue Feb 9, 2017 · 16 comments

Comments

@shixukai
Copy link

shixukai commented Feb 9, 2017

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.0 x64
Electron: 1.3.13
OS: Mac OS X 10.12.3
Thrown From: project-viewer package 0.3.43

Stack Trace

Uncaught Error: The workspace can only contain one instance of item [object Object]

At /Applications/Atom.app/Contents/Resources/app.asar/src/item-registry.js:11

Error: The workspace can only contain one instance of item [object Object]
    at ItemRegistry.module.exports.ItemRegistry.addItem (/app.asar/src/item-registry.js:11:15)
    at PaneContainer.module.exports.PaneContainer.addedPaneItem (/app.asar/src/pane-container.js:389:25)
    at /app.asar/src/pane-container.js:368:19
    at /app.asar/src/pane-container.js:95:16
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at PaneContainer.module.exports.PaneContainer.didAddPane (/app.asar/src/pane-container.js:308:27)
    at Pane.module.exports.Pane.setContainer (/app.asar/src/pane.js:131:26)
    at PaneContainer.module.exports.PaneContainer.setRoot (/app.asar/src/pane-container.js:162:17)
    at PaneContainer.module.exports.PaneContainer.deserialize (/app.asar/src/pane-container.js:62:12)
    at Workspace.module.exports.Workspace.deserialize (/app.asar/src/workspace.js:171:33)
    at Object.workspaceDeserialization (/packages/project-viewer/src/states.js:20:24)
    at /packages/project-viewer/src/list-item-component.js:74:17)

Commands

     -0:35.7.0 vim-mode-plus-ex-mode:open (input.hidden-input)
     -0:35.5.0 core:confirm (input.hidden-input)
     -0:31.3.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
  9x -0:30.6.0 vim-mode-plus:move-up (input.hidden-input)
     -0:29 vim-mode-plus:activate-linewise-visual-mode (input.hidden-input)
 10x -0:28.9.0 vim-mode-plus:move-down (input.hidden-input)
     -0:27.3.0 emmet:toggle-comment (input.hidden-input)
     -0:27.3.0 editor:toggle-line-comments (input.hidden-input)
     -0:25.7.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -0:25.6.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
     -0:25.1.0 vim-mode-plus:move-up (input.hidden-input)
     -0:25 vim-mode-plus:move-down (input.hidden-input)
     -0:24.9.0 vim-mode-plus:move-up (input.hidden-input)
     -0:24.8.0 vim-mode-plus:move-down (input.hidden-input)
     -0:24.6.0 vim-mode-plus-ex-mode:open (input.hidden-input)
     -0:24.3.0 core:confirm (input.hidden-input)

Non-Core Packages

atom-material-syntax 1.0.2 
atom-material-syntax-dark 0.2.7 
atom-material-ui 1.3.9 
atom-react-native-autocomplete 0.0.27 
atom-ternjs 0.17.0 
autocomplete-json 5.2.0 
autocomplete-modules 1.6.7 
autocomplete-paths 1.0.5 
autocomplete-python 1.8.43 
color-picker 2.2.5 
copy-filename 1.0.1 
copy-path 0.4.0 
emmet 2.4.3 
ex-mode 0.13.1 
file-icons 2.0.15 
filecolor 0.4.0 
flatwhite-syntax 0.8.0 
fonts 2.0.0 
github-atom-light-syntax 0.3.2 
gl-light-syntax 2.2.0 
highlight-column 0.5.2 
highlight-line 0.12.0 
highlight-selected 0.12.0 
hyperclick 0.0.40 
js-hyperclick 1.10.1 
language-babel 2.54.1 
language-javascript-jsx 0.3.7 
linter 1.11.21 
linter-csslint 1.3.3 
linter-eslint 8.1.0 
linter-sass-lint 1.7.4 
native-ui 0.20.3 
one-o-eight-syntax 0.23.2 
pigments 0.39.0 
platformio-ide-terminal 2.2.2 
prettier-atom 0.16.0 
project-viewer 0.3.43 
sync-settings 0.8.1 
tomorrow-night-blue-syntax 0.1.0 
tomorrow-night-eighties-syntax 1.0.2 
vim-mode-plus 0.82.0 
vim-mode-plus-ex-mode 0.8.1 
vim-mode-plus-keymaps-for-surround 0.2.1 
@jccguimaraes
Copy link
Owner

hey @shixukai,

thanks for reporting this, will sure investigate this out.

thank you

@skratchdot
Copy link

I'm seeing this pop back up in the new beta release:

[Enter steps to reproduce:]

  1. Open Atom
  2. Switch projects in the project viewer

Atom: 1.17.0-beta0 x64
Electron: 1.3.14
OS: Mac OS X 10.12.4
Thrown From: project-viewer package 1.0.12

Stack Trace

Uncaught Error: The workspace can only contain one instance of item [object Object]

At /Applications/Atom Beta.app/Contents/Resources/app/src/item-registry.js:11

Error: The workspace can only contain one instance of item [object Object]
    at ItemRegistry.module.exports.ItemRegistry.addItem (/Applications/Atom Beta.app/Contents/Resources/app/src/item-registry.js:11:1)
    at PaneContainer.didAddPaneItem (/Applications/Atom Beta.app/Contents/Resources/app/src/pane-container.js:265:1)
    at PaneContainer.didAddPane (/Applications/Atom Beta.app/Contents/Resources/app/src/pane-container.js:238:1)
    at Pane.module.exports.Pane.setContainer (/Applications/Atom Beta.app/Contents/Resources/app/src/pane.js:149:1)
    at PaneContainer.setRoot (/Applications/Atom Beta.app/Contents/Resources/app/src/pane-container.js:134:1)
    at PaneContainer.deserialize (/Applications/Atom Beta.app/Contents/Resources/app/src/pane-container.js:55:1)
    at Dock.deserialize (/Applications/Atom Beta.app/Contents/Resources/app/src/dock.js:362:1)
    at Workspace.deserialize (/Applications/Atom Beta.app/Contents/Resources/app/src/workspace.js:415:1)
    at AtomEnvironment.module.exports.AtomEnvironment.deserialize (/Applications/Atom Beta.app/Contents/Resources/app/src/atom-environment.js:1212:1)
    at /packages/project-viewer/src/project-view.js:244:10)
    at /packages/project-viewer/src/project-view.js:15:8)

Commands

  2x -0:15.5.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-when-scrolling)

Non-Core Packages

atom-beautify 0.29.18 
atom-ternjs 0.18.2 
atom-typescript 11.0.1 
busy-signal 1.3.0 
color-picker 2.2.5 
editorconfig 2.2.2 
file-icons 2.1.3 
git-time-machine 1.5.9 
hyperclick 0.0.40 
intentions 1.1.2 
js-hyperclick 1.10.1 
language-babel 2.57.3 
language-dustjs 0.3.0 
linter 2.1.2 
linter-eslint 8.1.5 
linter-flow 5.5.1 
linter-ui-default 1.2.2 
local-history 4.0.1 
minimap 4.27.1 
prettier-atom 0.26.0 
project-viewer 1.0.12 
sort-lines 0.14.0 
Sublime-Style-Column-Selection 1.7.4 

@jccguimaraes
Copy link
Owner

hey @skratchdot thanks for point this out, will have a look 👍

@jccguimaraes
Copy link
Owner

@skratchdot can you confirm this still happens in the 1.0.13? thanks

@skratchdot
Copy link

@jccguimaraes - it still seems to be happening for me in 1.0.13:

project-manager

@skratchdot
Copy link

@jccguimaraes - the gif is kind of bad because it starts after I had clicked my "Recent" project- and the UI was kind of hanging until the first red error showed up. Then I clicked a second project and the second red error showed up. So anytime I want to switch projects now, I have to restart Atom (e.g. I can only use the project that is selected when Atom opens- if I switch to a new project- nothing works and I have to restart Atom).

@jccguimaraes
Copy link
Owner

@skratchdot you are using beta channel right?

@jccguimaraes
Copy link
Owner

@skratchdot
Copy link

@jccguimaraes - yes, that's correct: the beta channel.

@jccguimaraes
Copy link
Owner

@skratchdot 1.17.0 is breaking PV, so i am investigating it. I think it's mainly because tree-view as changed a lot.

@skratchdot
Copy link

No worries. Just figured I'd let you know.

@jccguimaraes
Copy link
Owner

that was well spotted mate

@jccguimaraes
Copy link
Owner

i have read in the code where the problem occurs the following

// Ensure deserializing 1.17 state with pre 1.17 Atom does not error

So I have a small fix/hack but it will keep files open switching between projects (if that's ok) i can make that fix until a better solution exits (in 1.16) it ain't breaking

@skratchdot
Copy link

I'm fine with that behavior (but can't speak for all your other users)! Thanks again for this project.

@jccguimaraes
Copy link
Owner

published the hack into 1.0.14. hope it smooths the problem.

@skratchdot
Copy link

it's working for me! thanks @jccguimaraes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants