emmetio / sublime-tern

TernJS plugin for Sublime Text
222 stars 13 forks source link

AttributeError: '[object Object]' object has no attribute 'file' #31

Open swayf opened 11 years ago

swayf commented 11 years ago

on macox 10.8.4 sublime 2.0.2 build 2221

fresh install

on nodejs express project while trying to jump to definition get the next output:

TernJS: No need to update PyV8
Syncing project empty
Starting TernJS server for empty with 1 libs and 0 files
reloading /Users/Oleg/Library/Application Support/Sublime Text 2/Packages/User/Fetch.sublime-settings
loaded 2055 snippets
Package Control: Skipping automatic upgrade, last run at 2013-08-13 20:03:57, next run at 2013-08-13 21:03:57 or after
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 473, in run
    target_file = dfn['file']
AttributeError: '[object Object]' object has no attribute 'file'

what can it be? any thought?

swayf commented 11 years ago

seems this https://github.com/int3h/SublimeFixMacPath plugin helps

sergeche commented 11 years ago

No, the problem is, for some reason, Tern returned data about symbol in a way that ST plugin can parse. I’ll investigate this issue a bit later.

jeremyhill-up commented 10 years ago

I have this issue as well:

Traceback (most recent call last):
  File "C:\Users\igen894\apps\Sublime Text 3 Beta\sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "tern in C:\Users\igen894\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 497, in run
AttributeError: '[object Object]' object has no attribute 'file'

I am trying to jump to definition inside a module pattern, like how jQuery works:

( function( home, $, undefined ) {
...
  home.work = {
    init: function() {
    ...
    },
    ...
 };
}( window.home = window.home || {}, jQuery ) );

home.work.init(); <--jump to definition

lawsonfulton commented 10 years ago

I also have this issue when attempting to jump to definition:

Starting TernJS server for empty with 1 libs and 0 files Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublimeplugin.py", line 549, in run return self.run(edit) File "tern in /Users/lawson/Library/Application Support/Sublime Text 3/Installed Packages/TernJS.sublime-package", line 497, in run AttributeError: '[object Object]' object has no attribute 'file'

Has anybody found a solution?

chris-- commented 10 years ago

The same happens for me in ST3:

Syncing project /Users/chris/dev/sublime-projects/chakka.sublime-project
Starting TernJS server for /Users/chris/dev/sublime-projects/chakka.sublime-project with 2 libs and 7 files
Syncing project empty
Starting TernJS server for empty with 1 libs and 0 files
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "tern in /Users/christianvogt/Library/Application Support/Sublime Text 3/Installed Packages/TernJS.sublime-package", line 497, in run
AttributeError: '[object Object]' object has no attribute 'file'

My .sublime-project file contains this:

"ternjs": {
    "dir": "/Users/christianvogt/dev/chakka",
    "exclude": ["node_modules/**"],
    "include": ["js/**/*.js"],
    "libs": ["browser"],
    "plugins": {
        "node": {}
    }
}
linde12 commented 10 years ago

Same thing is happening for me as for chris--, ST3