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

Fatal error: missing '{' near line 2:16 #34

Closed
chriswrightdesign opened this Issue Jan 8, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@chriswrightdesign

chriswrightdesign commented Jan 8, 2014

This error has only popped up recently, and I noticed if I replaced uncss.js with an older version it corrected the issue. I'll see if I can compare the two to find out what the exact issue is.

@chriswrightdesign

This comment has been minimized.

chriswrightdesign commented Jan 8, 2014

It looks like in the try catch block the done(); has been moved.
The new one

uncss(src, options, function (output) {
                    grunt.file.write(f.dest, output);
                    done();
                });

the previous (one that works with no error for me)

uncss(src, options, function (output) {
                    grunt.file.write(f.dest, output);
                });
                done();

Moving it fixed the error.

@addyosmani

This comment has been minimized.

Member

addyosmani commented Jan 12, 2014

Weird. So, the old one was occasionally being called too early, even if the uncss process hadn't completely finished processing. I'll look into this again.

@pawelmhm

This comment has been minimized.

pawelmhm commented Jan 13, 2014

I get this error when I add "stylesheets" options, uncss.js (version 0.1.6). Runs fine if I remove stylsheet array.

This configuration returns error mentioned above:

uncss: {
        dist: {
            files: {
                'build/css/style.css':['src/search_box.html', 'src/results.html']
            }
        },
         options: {
            ignore:["#linkToTaburl",".searchResultsTemplate",".page-header",".results",".result-item"],
            stylesheets: ["src/lib/css/bootstrap.min.css","src/lib/css/customize_bootstrap.css"]
        } 
    },

But this with commented stylesheets works ok:

 uncss: {
        dist: {
            files: {
                'build/css/style.css':['src/search_box.html', 'src/results.html']
            }
        },
         options: {
            ignore:["#linkToTaburl",".searchResultsTemplate",".page-header",".results",".result-item"] 
           /* stylesheets: ["src/lib/css/bootstrap.min.css","src/lib/css/customize_bootstrap.css"] */
        } 
    },

UPDATE:

after some bug hunting I've found that exception is generated by css.parse, line 215, in my setup this has the following path:
/home/pawel/js/searcher/node_modules/grunt-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse

pawelmhm added a commit to pawelmhm/grunt-uncss that referenced this issue Jan 14, 2014

@addyosmani

This comment has been minimized.

Member

addyosmani commented Jan 21, 2014

Closing as we landed #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment