MadLittleMods / postcss-css-variables

PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation
https://madlittlemods.github.io/postcss-css-variables/playground/
Other
536 stars 62 forks source link

Error event indexOf #33

Closed stephenway closed 8 years ago

stephenway commented 8 years ago

This is an error I get when I try to run this plugin in my gulp postcss processors. Unsure of if this is related to any other issues, but it's definitely blocking me.

events.js:154
      throw er; // Unhandled 'error' event
      ^
TypeError: Cannot read property 'indexOf' of undefined
    at OldValue.check (/Users/Stephen/projects/navis-ui/node_modules/autoprefixer/lib/old-value.js:17:16)
    at /Users/Stephen/projects/navis-ui/node_modules/autoprefixer/lib/processor.js:198:25
    at /Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:94:28
    at /Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:81:26
    at Rule.each (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:68:22)
    at Rule.walk (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:80:21)
    at /Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:83:32
    at Root.each (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:68:22)
    at Root.walk (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:80:21)
    at Root.walkDecls (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/container.js:92:25)
    at Processor.remove (/Users/Stephen/projects/navis-ui/node_modules/autoprefixer/lib/processor.js:172:18)
    at plugin (/Users/Stephen/projects/navis-ui/node_modules/autoprefixer/lib/autoprefixer.js:64:28)
    at LazyResult.run (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/lazy-result.js:206:20)
    at /Users/Stephen/projects/navis-ui/node_modules/postcss/lib/lazy-result.js:120:37
    at LazyResult.asyncTick (/Users/Stephen/projects/navis-ui/node_modules/postcss/lib/lazy-result.js:134:15)
    at /Users/Stephen/projects/navis-ui/node_modules/postcss/lib/lazy-result.js:132:27
MadLittleMods commented 8 years ago

@stephenway Can you share the input? Something reproducible in the sandbox would be great, https://madlittlemods.github.io/postcss-css-variables/playground/

stephenway commented 8 years ago

Unfortunately I am unable to pinpoint where it fails right now, but I know that this error only occurs when a variable doesn't have a definition in root. My next step is to just comment large portions of my code out to see where its happening.

Side-note, it would help me if I knew where it was breaking via the error message. Do you have plans to change error reporting?

MadLittleMods commented 8 years ago

@stephenway Probably related to https://github.com/MadLittleMods/postcss-css-variables/issues/22

stephenway commented 8 years ago

Yea as I'm working through my partials I'm seeing that it's just issues with inheritance that need to get worked out. Thanks!