Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot convert undefined or null to object at Function.keys #99

Closed
michtio opened this issue Dec 2, 2015 · 3 comments
Closed

Comments

@michtio
Copy link

michtio commented Dec 2, 2015

I'm trying creating a task to check my js, but every time I call the function it fails:

my code (just stripped it down to the essentials):

var gulp = require('gulp');
var jscs = require('gulp-jscs');

gulp.task('lintjs', function(){
  gulp.src(['./app/js/**/*.js','./.tmp/js/**/*.js','./gulpfile.js','./tools/**/*.js'])
    .pipe(jscs())
    .pipe(jscs.reporter())
});

the error:

[11:25:13] Starting 'lintjs'...
[11:25:14] 'lintjs' errored after 305 ms
[11:25:14] TypeError: Cannot convert undefined or null to object
  at Function.keys (native)
  at copyConfiguration (/Users/mike/Development/lighthouse-    workflow/node_modules/jscs/lib/config/configuration.js:1181:12)
  at NodeConfiguration.Configuration._processConfig (/Users/mike/Development/lighthouse-workflow/node_modules/jscs/lib/config/configuration.js:474:5)
  at NodeConfiguration.Configuration.load (/Users/mike/Development/lighthouse-workflow/node_modules/jscs/lib/config/configuration.js:238:10)
  at [object Object].StringChecker.configure (/Users/mike/Development/lighthouse-workflow/node_modules/jscs/lib/string-checker.js:67:29)
  at [object Object].Checker.configure (/Users/mike/Development/lighthouse-workflow/node_modules/jscs/lib/checker.js:28:39)
  at module.exports (/Users/mike/Development/lighthouse-workflow/node_modules/gulp-jscs/index.js:35:10)
  at Gulp.<anonymous> (/Users/mike/Development/lighthouse-workflow/tools/devtasks/linting.js:90:13)
  at module.exports (/Users/mike/Development/lighthouse-workflow/node_modules/orchestrator/lib/runTask.js:34:7)
  at Gulp.Orchestrator._runTask (/Users/mike/Development/lighthouse-workflow/node_modules/orchestrator/index.js:273:3)
  at Gulp.Orchestrator._runStep (/Users/mike/Development/lighthouse-workflow/node_modules/orchestrator/index.js:214:10)
  at Gulp.Orchestrator.start (/Users/mike/Development/lighthouse-workflow/node_modules/orchestrator/index.js:134:8)
  at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
  at doNTCallback0 (node.js:430:9)
  at process._tickCallback (node.js:359:13)
  at Function.Module.runMain (module.js:459:11)
  at startup (node.js:138:18)
  at node.js:974:3
@michtio
Copy link
Author

michtio commented Dec 2, 2015

apparently a .jscsrc file is required. Maybe write that down in your docs, it's obligatory to create such a file? With a .jscsrc file I don't get any errors.

@michtio michtio closed this as completed Dec 2, 2015
@thebiltheory
Copy link

Hey @mike-lighthouse,
I have exactly the same issue it doesn't seems working even with the .jscsrc file.
Where did you put your file?

@radek11
Copy link

radek11 commented Dec 1, 2016

put the .jscsrc file where the gulpfile.js is (or I think where gulp can find it)

@omotayo89
Copy link

I have same eror pls help !!!!!!!!! i have .jscrc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants