Grunt-karma RangeError Maximum Error

Recently, I wanted to start using Grunt to improve my development workflow. Although I had problems when Grunt is up and running. After creating the package.json file and the Grunt file.js I tried to run a simple test using grunt-karma with no luck.

All I get is a mistake

Loading "grunt-karma.js" tasks...ERROR

RangeError: Maximum call stack size exceeded

I am running node version 10.12 with grunt-cli and grunting versions 0.1.9 and 0.4.1 respectively.

Below is the file of my package with all the dependencies of my dev and my grunt file.

package.json

 { "name": "crudangular", "version": "0.0.1", "devDependencies": { "grunt": "~0.4.1", "karma": "~0.8.6", "grunt-karma": "~0.4.4", "phantomjs": "~1.9.1-0" } } 

Gruntfile.js

 module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), karma: { unit:{ configFile: 'karma.conf.js' } } }); grunt.loadNpmTasks('grunt-karma'); grunt.registerTask('default',['karma']); } 

Any help would be greatly appreciated. Thank you in advance.

+4
source share
2 answers

Someone else had this problem and ask about it at the IRC. Reinstalling node.js and npm helped them solve this problem.

Also make sure you clear the cache-npm. You can also try to get npm install grunt-karma into a temporary directory, then npm install in this directory and run the tests using grunt test . This way you can make sure that this is a problem with the plugin. If the launch of the residues fails, please report the problem on the plugin page, specify the OS and version of the node. Plugin page: https://github.com/karma-runner/grunt-karma

+2
source

I had this problem when I accidentally included angular moments in my karma tests. Just delete the import.

+1
source

Source: https://habr.com/ru/post/1487671/


All Articles