anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

TypeError: Cannot read property 'browsers' of undefined #66

Closed jitendravyas closed 7 years ago

jitendravyas commented 7 years ago
        postcss: {
            options: {
                syntax: require('postcss-scss'),
                processors: [
                    require('autoprefixer')({ add: false}),
                    require('doiuse')(),
                ]
            },
            dist: {
                src: 'app/styles/app.css'
            }
        },

Getting an error

    postcss: {
        options: {
            syntax: require('postcss-scss'),
            processors: [
                require('doiuse')(),
            ]
        },
        dist: {
            src: 'app/styles/app.css'
        }
    },

error

❯ grunt postcss Loading "Gruntfile.js" tasks...ERROR

TypeError: Cannot read property 'browsers' of undefined No "postcss" targets found. Warning: Task "postcss" failed. Use --force to continue.

Aborted due to warnings.

ismay commented 7 years ago

That's correct. It's because you're not passing any options. At the very least you'll need to pass an empty object if I'm not mistaken. See the readme for an example: https://github.com/anandthakker/doiuse#js

Hope that helps. For questions that aren't bug reports or feature requests I'd recommend stack overflow, as that's more useful for support requests.