csscomb / sublime-csscomb

Sublime plugin for CSScomb—CSS coding style formatter
398 stars 61 forks source link

Can't run after upgrading to new version #29

Closed TrevorBurnham closed 10 years ago

TrevorBurnham commented 10 years ago

I'm on Sublime Text 3. Ever since I upgraded from the old CSScomb package (pre-"CSScomb JS") via Package Control, the command has been a no-op: When I run the "Run CSSComb JS" command, nothing happens. There is no output in the Sublime Text console.

I've tried removing and re-installing the package through Package Control, with the same result. Package Control installs the package to the directory Sublime Text 3/Packages/CSScomb. I notice that if I go to Preferences -> Package Settings -> CSScomb JS -> Settings - Default, I get the console message

Unable to open /Users/tb/Library/Application Support/Sublime Text 3/Packages/CSScomb JS/CSScomb JS.sublime-settings

That is, the directory it tries to look in for the settings file (CSScomb js) doesn't match the directory that the package was actually installed in (CSScomb). Any idea why this is happening?

ghost commented 10 years ago

Same here!

ghost commented 10 years ago

I'm having the same problem.

wonderfool commented 10 years ago

I had the same issue as well with CSSComb attempting to load its preferences from CSScomb JS/. That seemed to fix itself after uninstalling and reinstalling, but once I got the command to run I started noticing errors like this in the console:

error: CSScomb error:

/Users/tu/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:412
            throw e;
                  ^

Please check the validity of the block starting from line #3

3*|     -webkit-transform: rotate(90deg);
4 |     -webkit-transform-origin: left bottom;
ghost commented 10 years ago

This error no longer occurs to me after the reinstallation, however the plugin is not properly formatting the CSS as before (strange spaces between lines, etc.)

allybee commented 10 years ago

I had the same issue with the plugin simply not working, then I was having similar problems with formatting after reinstalling.

I have gotten the plugin to work by copying the default settings file to a .csscomb.json file in my HOME directory. I then referenced this config file in /Users/allysonbeckers/Library/Application Support/Sublime Text 3/Packages/CSScomb/CSScomb JS.sublime-settings like so:

{ 
  "custom_config_path": "/Users/allysonbeckers/.csscomb.json"
}

Note: If I recall correctly, I had to remove the "exclude" option block because it was throwing an error.

maxfenton commented 10 years ago

Thanks all for sharing — I have the same/similar issues.

FileNotFoundError: [Errno 2] No such file or directory: '/Users/max/Library/Application Support/Sublime Text 3/Packages/CSScomb JS/CSScomb JS.sublime-settings'

There isn't a 'CSScomb JS' directory at all: it's called 'CSScomb' — I did what @allybee suggested and moved my config to my user root as a dot file instead, and it seems to be working.

tonyganch commented 10 years ago

Can you please update the plugin and tell me whether the problem remains? Removing/installing may help too.

tonyganch commented 10 years ago

@wonderfool, can you please open an issue here and show the code that fails? The whole block with selectors and rules. File's syntax (css/less/scss) and version of CSScomb or plugin will be helpful, too.

websirnik commented 10 years ago

I've just updated to sublime-csscomb v.1.0.0. (Re-installed). When I run the command nothing happens(both via the shortcut and the menu). Sublime console states nothing. Is there a way to debug this? Could it be a conflict with other packages? I have quite a number of them. I have node installed in /usr/local/bin.

TrevorBurnham commented 10 years ago

Removing and reinstalling the plugin fixed the problem with the settings files being in the wrong directory, but the "Run CSScomb" command still does nothing (no console output).

wonderfool commented 10 years ago

@tonyganch - I found the original block of CSS which caused the error but since reinstalling the plugin I'm no longer able to recreate it. When I "Run CSScomb" now nothing happens (I also receive no console output). Shall I still open an issue?

tonyganch commented 10 years ago

@wonderfool @TrevorBurnham @websirnik, this could be a conflict of settings. Can you please try to do following:

  1. Open your User settings (Preferences > Package Settings > CSScomb > Settings - User)
  2. If it has any valuable content, copy it to some safe place for a while.
  3. Paste here the content of Default settings (Preferences > Package Settings > CSScomb > Settings - Default)
  4. Run CSScomb for an acceptable file.
wonderfool commented 10 years ago

Hi, my CSScomb user settings were empty but I think I've stumbled across some more useful info:

An example of that last scenario - if the following CSS is selected:

    background: #3cf706;
    position: fixed;
    z-index: 2147483647;

    border-radius: 2px 2px 0px 0px;

    padding: 6px 10px 6px 10px;

...then running CSScomb yields this error:

CSScomb error:

/Users/tu/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:412
            throw e;
                  ^

Please check the validity of the block starting from line #1

1*|     background: #3cf706;
2 |     position: fixed;
3 |     z-index: 100;

Gonzales PE version: 3.0.0-10
CSScomb Core version: 2.0.2

We used to be able to sort blocks of declarations, correct?

TrevorBurnham commented 10 years ago

:facepalm: OK, wonderfool's attention to the syntax setting has helped me get to the heart of the issue: The "no effect" behavior I was observing was because I had my syntax set to "CSS3" instead of "CSS" (courtesy of https://github.com/i-akhmadullin/Sublime-CSS3). If I switch to CSS, I lose some of the fancy syntax highlighting, but CSSComb works.

I'm sure it should be possible to make CSSComb recognize that I am, in fact, editing a CSS file even though I'm using a third-party syntax. Relatedly, CSSComb's key binding should only apply in CSS contexts. Currently it conflicts with the SublimeGit default key binding for "Amend Commit," even though that key binding only applies in the "SublimeGit Status" tab.

alexnewmannn commented 10 years ago

I was getting these issues, fixed it by doing the following:

Although on windows there's an issue - 'command line is too long'; this seems to be because of a line limit in our custom config, the issue does not occur on mac with identical configs and files.

websirnik commented 10 years ago

Had exactly the same thing as @TrevorBurnham. Would be great to get support for https://github.com/i-akhmadullin/Sublime-CSS3.

tonyganch commented 10 years ago

Sublime-CSS3 issue now lives here: https://github.com/csscomb/sublime-csscomb/issues/30 Feel free to update with other syntaxes.

maxfenton commented 10 years ago

Thanks!

1-800-jono commented 9 years ago

I'm having the same problem: "/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:412 throw e; ^Please check the validity of the block starting from line #2472"

I tried removing/installing and also tried pasting the default settings to the user settings - same error no matter what.

Using OSX 10.9.4 with sublime text 3