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

sass gen comments cause error #2

Open
ericfong opened this issue Aug 2, 2014 · 2 comments
Open

sass gen comments cause error #2

ericfong opened this issue Aug 2, 2014 · 2 comments

Comments

@ericfong
Copy link

ericfong commented Aug 2, 2014

    rework('@-keyframes spin {  /*SASS GEN COMMENTS CAUSE IT DIE*/  0% {} 100%{} }')
    .use(rework.url(function(url){
        console.log(url);
        return url;
    }))
    .toString();


TypeError: Cannot call method 'forEach' of undefined
at func (/Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:37:16)
at /Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:19:7
at /Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:29:9
at Array.forEach (native)
at /Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:28:22
at Array.forEach (native)
at visit (/Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:18:14)
at /Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:17:5
at Rework.use (/Users/eric/Dropbox/waatrade-dpd/webapp/node_modules/rework/index.js:49:3)
at main (/Users/eric/Dropbox/waatrade-dpd/webapp/b.js:16:10)
@mpdude
Copy link

mpdude commented Aug 9, 2014

Me too :)

The input @-webkit-keyframes x { /**/ } is already enough to fail.

Interestingly, for me the line numbers are partially off by one.

/home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:36
  declarations.forEach(function(decl){
              ^
TypeError: Cannot read property 'forEach' of undefined
    at func (/home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:36:15)
    at /home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:18:7
    at /home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:28:9
    at Array.forEach (native)
    at /home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:27:22
    at Array.forEach (native)
    at visit (/home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/node_modules/rework-visit/index.js:18:14)
    at /home/mp/test/node_modules/rework-plugin-url/node_modules/rework-plugin-function/index.js:17:5
    at Rework.use (/home/mp/test/node_modules/rework/index.js:49:3)
    at Object.<anonymous> (/home/mp/test/test.js:6:2)

@sendel
Copy link

sendel commented Dec 8, 2014

me too
simple fix for function.js:

function func(declarations, functions, functionMatcher, parseArgs) {
  if (false !== parseArgs) parseArgs = true;
  if (declarations == undefined){ console.log('empty declaration may be @-webkit'); return;}

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

3 participants