cheton/browserify-css

Transform fails with: "Cannot read property 'stringify' of undefined"

Closed this issue · 3 comments

I get the following error right when trying to use the transform:

TypeError: Cannot read property 'stringify' of undefined
    at /Users/fernando/Dev/AffinityApp/node_modules/browserify-css/css-transform.js:119:30
    at Function.forEach (/Users/fernando/Dev/AffinityApp/node_modules/browserify-css/node_modules/lodash/dist/lodash.js:3297:15)

If you look at the line in question (css-transform.js:119), what you see is:

var css = css.stringify({
                    stylesheet: {
                        rules: [ rule ]
                    }
                });

The file history shows that recently that variable was renamed from "result" to "css", colliding with anothe definition in the outer scope.

I'm not really sure why that causes a problem, but after renaming the variable back, the issue seems to be solved.

Hi fcuenca,

It's fixed in v0.3.3 and has been published to NPM as well. Thank you for your informing.

d8eaf45#diff-b306c62fd81d7dcddc91e13d615b86df

Confirmed. Thanks!!

Added some tests to ensure the browserify-css transform is working