sublime-tern icon indicating copy to clipboard operation
sublime-tern copied to clipboard

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

Open swayf opened this issue 12 years ago • 6 comments

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 avatar Aug 13 '13 18:08 swayf

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

swayf avatar Aug 13 '13 19:08 swayf

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.

sergeche avatar Aug 15 '13 09:08 sergeche

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

jeremyhill-up avatar Mar 28 '14 19:03 jeremyhill-up

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/sublime_plugin.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?

lawsonfulton avatar May 05 '14 19:05 lawsonfulton

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": {}
    }
}

chris-- avatar Jun 24 '14 15:06 chris--

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

linde12 avatar Sep 17 '14 14:09 linde12