Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Conflict with grunt-karma? #87

Closed
ogonkov opened this issue Feb 29, 2016 · 1 comment
Closed

Conflict with grunt-karma? #87

ogonkov opened this issue Feb 29, 2016 · 1 comment

Comments

@ogonkov
Copy link

ogonkov commented Feb 29, 2016

I got Gruntfile like this:

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        postcss: {
            options: {
                processors: [
                    require('autoprefixer')({
                        browsers: [
                            'last 3 versions',
                            'ie >= 8'
                        ]
                    })
                ]
            },
            dist: {
                expand: true,
                cwd: 'foo/static/css',
                src: ['*.css', '!*.min.css'],
                dest: 'foo/static/css2'
            }
        }
    });

    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-postcss');
    // if move task grunt-karma above here everything breaking

    grunt.registerTask('default', ['postcss']);

};

Everything works as expected.

But, if i put grunt-karma load after grunt-postcss i got exception:

$ grunt postcss --stack
Fatal error: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at lib$es6$promise$$internal$$fulfill (/Users/username/WebstormProjects/test-postcss/node_modules/es6-promise/dist/es6-promise.js:303:31)
    at lib$es6$promise$$internal$$resolve (/Users/username/WebstormProjects/test-postcss/node_modules/es6-promise/dist/es6-promise.js:285:9)
    at lib$es6$promise$$internal$$invokeCallback (/Users/username/WebstormProjects/test-postcss/node_modules/es6-promise/dist/es6-promise.js:396:9)
    at /Users/username/WebstormProjects/test-postcss/node_modules/es6-promise/dist/es6-promise.js:166:11
    at lib$es6$promise$asap$$flush (/Users/username/WebstormProjects/test-postcss/node_modules/es6-promise/dist/es6-promise.js:119:9)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
    at Function.Module.runMain (module.js:477:11)
    at startup (node.js:117:18)
    at node.js:951:3

What's wrong here?

My package.json

{
  "name": "test-postcss",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "autoprefixer": "^6.3.3",
    "grunt": "^0.4.5",
    "grunt-karma": "^0.12.1",
    "grunt-postcss": "^0.7.2",
    "jasmine-core": "^2.4.1",
    "karma": "^0.13.21",
    "karma-html2js-preprocessor": "^0.1.0",
    "karma-jasmine": "^0.3.7",
    "karma-jasmine-ajax": "^0.1.13",
    "karma-junit-reporter": "^0.3.8",
    "karma-phantomjs-launcher": "^1.0.0",
    "karma-requirejs": "^0.2.5",
    "phantomjs-prebuilt": "^2.1.4",
    "requirejs": "^2.1.22"
  }
}
@ogonkov
Copy link
Author

ogonkov commented Feb 29, 2016

Seems related to zloirock/core-js#176

@ogonkov ogonkov closed this as completed Feb 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant