akalongman / sublimetext-codeformatter

Code Formatter plugin for ST2/ST3
MIT License
772 stars 130 forks source link

Getting `TypeError: argument of type 'NoneType' is not iterable` #243

Open ilearnio opened 8 years ago

ilearnio commented 8 years ago

Just installed this plugin and got this when tried to format .js file:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 618, in run_
    return self.run(edit)
  File "/Users/Admin/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/CodeFormatter.py", line 79, in run
    formatter = Formatter(self.view, file_name, syntax, saving)
  File "/Users/Admin/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/formatter.py", line 59, in __init__
    if ("syntaxes" in opts and opts["syntaxes"]):
TypeError: argument of type 'NoneType' is not iterable

OS X, Sublime Text 3117

miculprogramator commented 8 years ago

The same in Manjaro Linux

tuha305 commented 8 years ago

It seems lack of user setting file. Try to touch or create the User Setting for CodeFormatter.

Preferences > Package Settings > CodeFormatter > Settings - User

It might help.

kenvunz commented 8 years ago

as @tuha305 mentioned, create User Settings, cut and paste the default config over fixed the problem for me

gambolputty commented 7 years ago

Copying codeformatter_js_options from default to user settings didn't fix this issue for me.

gambolputty commented 7 years ago

As mentioned in #208, restarting Sublime Text solved this issue for me.