kristoferjoseph / postcss-modular-scale

PostCSS plugin for adding modular scale to your styles
MIT License
53 stars 9 forks source link

console: undefined [undefined] #9

Closed JamesJosephFinn closed 8 years ago

JamesJosephFinn commented 8 years ago

The plugin works great, but this error gets printed to the console at compile time:

src/css/styles.css
undefined [undefined]

The file listed above in the printout is actually just a manifest containing a bunch of @import statements. The source of the error is the ms() function. If I comment out the declaration in my typography partial, the error does not print.

Note that I am passing the bases and ratios arrays to the plugin in my config. I am not using the double hyphen vars in my stylesheet. This may be the cause.

Thanks for the great tool!

VinSpee commented 8 years ago

I'm also seeing this issue, but I am using double hyphen vars, so I don't think that's it. Any idea where it might be coming from?

justinmetros commented 8 years ago

Not sure of the solution, but I see part of the problem.

postcss-reporter doesn't like the result.messages.push() arguments.

Commenting out lines 33,40 and 58 makes the undefined logs go away, and tool works just fine.

justinmetros commented 8 years ago

Hey Kris!

Awesome work on this, holmes!

Officially including this in new projects, replacing the sass version. Really love your implementation <3

Taking a slightly closer look, the results.message used in your tests seems to conflict with other post-css error-sniffing plugins.

Would you consider removing or refactoring them for the sake of keeping our consoles clean?

Or be open to a pull request that addresses this?

Clearly the plugin works extremely well, but it can be a bit confusing / distracting seeing those undefined errors when piping in some of the error reporting tools out there.

kristoferjoseph commented 8 years ago

@justinmetros Always open to making things better :)

justinmetros commented 8 years ago

Awesome :+1:

VinSpee commented 8 years ago

Thanks!