Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't convert 'NoneType' object to str implicitly #7

Open
Djspaceg opened this issue May 13, 2016 · 7 comments
Open

Can't convert 'NoneType' object to str implicitly #7

Djspaceg opened this issue May 13, 2016 · 7 comments

Comments

@Djspaceg
Copy link

I installed this today, and I really like it! However, I keep getting errors like these. What additional debug information can I provide to help resolve this issue?

Unexpected error(<class 'TypeError'>): Can't convert 'NoneType' object to str implicitly
error: Can't convert 'NoneType' object to str implicitly

This is the eslinter output:

myFileName.js: line 3, col 8, Warning - 'SettingsUtils' is defined but never used (no-unused-vars)
myFileName.js: line 6, col 3, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 6, col 20, Warning - Missing space before function parentheses. (space-before-function-paren)
myFileName.js: line 7, col 5, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 8, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 9, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 10, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 14, col 3, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 14, col 23, Warning - Missing space before function parentheses. (space-before-function-paren)
myFileName.js: line 15, col 5, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 16, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 17, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
myFileName.js: line 18, col 7, Warning - Expected indentation of 1 tab character but found 0. (indent)
@elicwhite
Copy link
Owner

What operating system are you using? Does the error output provide a line number or stack trace or anything that can help track it down in the formatter?

For these sublime plugins I'm much more likely to accept PRs that fix an issue than to actually get in there to get it sorted out. Perhaps by looking at the code and this error you might be able to track it down a bit more.

@Djspaceg
Copy link
Author

Thanks for replying, @TheSavior. Mac OS X 10.11, and no, sorry it didn't include line numbers or any other information. I have SublimeLinter debugging enabled. Does ESLint-Formatter have any similar config to enable more verbose error output?

I'm afraid I don't know python, and would only cause more harm than good if I went mucking through the code. Sorry.

@tony1223
Copy link

I have same issue. OSX 10.11.5 , sublime build 3114 .

I installed the plugin , click the "ESlinkt formatter" > "format this file" and the error comes in the console.

Unexpected error(<class 'TypeError'>): Can't convert 'NoneType' object to str implicitly
error: Can't convert 'NoneType' object to str implicitly

I cant get any more detail information because there's no more detail i could get.

I think it would be better if you could print the stacktrace in your error handler function .

    except:
      # Something bad happened.
      msg = str(sys.exc_info()[1])
      print("Unexpected error({0}): {1}".format(sys.exc_info()[0], msg))
      sublime.error_message(msg)

@pixelass
Copy link

pixelass commented Dec 6, 2016

Any news on this issue?

OS X 10.12.1 (16B2657)
Sublime Build 3126

Console output

Unexpected error(<class 'TypeError'>): Can't convert 'NoneType' object to str implicitly
error: Can't convert 'NoneType' object to str implicitly

@elicwhite
Copy link
Owner

I would be happy to accept a pull request if someone can figure this out

@schmidtk
Copy link

schmidtk commented Jan 6, 2017

This seems to happen when the plugin doesn't have a file to process. I notice it when I save a file, get sublime linter warnings on save, and run the formatter with the warnings still displayed. If I simply close the warnings so the file has focus again, the formatter runs fine.

I get the same error with any other sublime popup open, like Ctrl+P or Ctrl+Shift+P, and also if I run the formatter with an empty column focused.

Hope this helps narrow it down in case someone wants to look into a solution.

@lazamar
Copy link

lazamar commented Nov 12, 2018

In OSX I fixed it by removing my custom config of eslint_path and node_path in Eslint-Formatter settings.
I had these settings because I imported my config from my Linux installation.
In the object I only specified paths for linux but still it was interfering with my OSX installation somehow.

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

No branches or pull requests

6 participants