lamabiker / atom-ember-cli-helper

Ember CLI integration for the Atom editor
https://atom.io/packages/ember-cli-helper
MIT License
26 stars 13 forks source link

Uncaught TypeError: Cannot read property 'file' of undefined #44

Closed danevans closed 6 years ago

danevans commented 6 years ago
  1. Open a template
  2. Click the c/t button to open the corresponding controller.

Atom: 1.23.0-beta1 x64 Electron: 1.6.15 OS: Mac OS X 10.13.1 Thrown From: ember-cli-helper package 0.16.0

Stack Trace

Uncaught TypeError: Cannot read property 'file' of undefined

At /Users/danston/.atom/packages/ember-cli-helper/lib/ember-cli-helper-view.coffee:110

TypeError: Cannot read property 'file' of undefined
    at EmberCliHelperView.module.exports.EmberCliHelperView.getPathComponents (/packages/ember-cli-helper/lib/ember-cli-helper-view.coffee:110:26)
    at EmberCliHelperView.module.exports.EmberCliHelperView.switchFile (/packages/ember-cli-helper/lib/ember-cli-helper-view.coffee:132:51)
    at /packages/ember-cli-helper/node_modules/atom-space-pen-views/node_modules/space-pen/lib/space-pen.js:220:36)
    at HTMLButtonElement.dispatch (/packages/ember-cli-helper/node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLButtonElement.elemData.handle (/packages/ember-cli-helper/node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -3:01.1.0 core:close (div.results-view.focusable-panel)
     -2:55.5.0 fuzzy-finder:toggle-file-finder (input.hidden-input)
  5x -2:54 core:backspace (input.hidden-input)
     -2:52.7.0 core:confirm (input.hidden-input)
     -2:38.2.0 core:close (input.hidden-input)
     -2:27.4.0 core:select-all (input.hidden-input)
     -2:27.2.0 core:backspace (input.hidden-input)
  3x -2:14.4.0 core:close (input.hidden-input)
     -2:13.1.0 fuzzy-finder:toggle-file-finder (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
  4x -2:10.6.0 core:backspace (input.hidden-input)
     -2:08.0 core:confirm (input.hidden-input)
     -1:49 project-find:show (input.hidden-input)
     -1:46.6.0 core:confirm (input.hidden-input)
     -1:41.1.0 core:close (div.results-view.focusable-panel)
  5x -0:43.2.0 core:backspace (input.hidden-input)
     -0:17 tree-view:reveal-active-file (input.hidden-input)

Non-Core Packages

activate-power-mode 2.6.0 
atom-beautify 0.30.6 
atom-handlebars 1.3.0 
atom-jade 0.3.0 
atom-typescript 11.0.10 
blame 1.0.1 
busy-signal 1.4.3 
docblockr 0.13.2 
ember-cli-helper 0.16.0 
ember-snippets 2.1.5 
file-icons 2.1.14 
intentions 1.1.5 
language-ember-htmlbars 0.4.0 
language-proto 0.8.0 
language-protobuf 0.7.1 
language-pug 0.0.21 
language-slim 1.0.0 
linter 2.2.0 
linter-eslint 8.4.0 
linter-ui-default 1.6.10 
minimap 4.29.7 
minimap-git-diff 4.3.1 
multi-cursor 2.1.5 
open-in-browser 0.5.2 
open-on-bitbucket 0.5.0 
split-diff 1.5.1 
termination 0.6.1 
todo-show 2.1.0 
toggle-quotes 1.0.1 
lamabiker commented 6 years ago

Hi @danevans I can't reproduce the issue, could you confirm that it occurs on different projects? Thanks

danevans commented 6 years ago

Created a new test application and still saw it happening.

  1. ember new test-application
  2. ember g component my-component (creates the component and template)
  3. Open the component template.
  4. Click the c/t button.

I tried this with a component and creating a controller/template and got the same exception both times.

Please note that I'm running the beta channel of atom.

lamabiker commented 6 years ago

I still can't reproduce the issue, which version of Ember are you running?

danevans commented 6 years ago

It appears I used 2.15.3. Upgraded and tested on 2.17.0 and it works there so it likely is something to do with the version.

lamabiker commented 6 years ago

Curious, I use it on lower versions without any issue. Maybe specific to 2.15.3. Please let me know if it happens again.

MikiDi commented 2 years ago

This happens when you try toggling from an active tab without an active cursor in it. You can reproduce this state by clicking a file in the tree an subsequently clicking the toggle button. Once you clicked in the buffer and a cursor appears, this is no longer reproducible.