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

"Cannot read property 'split' of undefined" error #136

Closed
piranna opened this issue May 29, 2015 · 12 comments
Closed

"Cannot read property 'split' of undefined" error #136

piranna opened this issue May 29, 2015 · 12 comments

Comments

@piranna
Copy link

piranna commented May 29, 2015

With grunt-jsdoc 0.6.6 I'm getting the next error:

Running "jsdoc:all" (jsdoc) task
Verifying property jsdoc.all exists in config...OK
Files: package.json, README.md, lib/WebRtcPeer.js, lib/browser.js, lib/index.js, test/WebRtcPeer.js, test/_common.js -> doc/jsdoc
Options: private, ignoreWarnings=false, timeout=60
Warning: Cannot read property 'split' of undefined Use --force to continue.

At the same time, executing jsdoc 3.3.0 (the one installed as dependency of grunt-jsdoc) directly it works correctly:

[piranna@Mabuk:~/workspace/kurento-utils-js]
 (master) > node_modules/grunt-jsdoc/node_modules/.bin/jsdoc package.json README.md lib/*.js test/*.js -d doc/jsdoc --verbose
Parsing /home/piranna/workspace/kurento-utils-js/lib/browser.js ...complete.
Parsing /home/piranna/workspace/kurento-utils-js/lib/index.js ...complete.
Parsing /home/piranna/workspace/kurento-utils-js/lib/WebRtcPeer.js ...complete.
Parsing /home/piranna/workspace/kurento-utils-js/test/WebRtcPeer.js ...complete.
Generating output files...complete.
Finished running in 0.63 seconds.
@piranna
Copy link
Author

piranna commented May 29, 2015

The configuration of Gruntfile is

    jsdoc: {
      all: {
        src: ['package.json', 'README.md', 'lib/**/*.js', 'test/*.js'],
        dest: 'doc/jsdoc'
      }
    },

@krampstudio
Copy link
Owner

What's your OS?
Also could you do the following tests for me :

  • in node_modules/grunt-jsdoc/tasks/lib/exec.js could you add console.log('nodePath', nodePath); line 66, run it again and give me the result.
  • run grunt jsdoc:all --debug copy/paste the command after the Running : tag and try it.

thanks

@piranna
Copy link
Author

piranna commented May 29, 2015

What's your OS?

Ubuntu 15.04

in node_modules/grunt-jsdoc/tasks/lib/exec.js could you add console.log('nodePath', nodePath); line 66, run it again and give me the result.

nodePath /usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript

Just before the paths array.

run grunt jsdoc:all --debug copy/paste the command after the Running : tag and try it.

Running "jsdoc:all" (jsdoc) task
[D] Task source: /home/piranna/workspace/kurento-utils-js/node_modules/grunt-jsdoc/tasks/jsdoc-plugin.js
nodePath /usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
[D] Using jsdoc from : node_modules/grunt-jsdoc/node_modules/.bin/jsdoc
[D] Running : node_modules/grunt-jsdoc/node_modules/.bin/jsdoc --destination doc/jsdoc --private package.json README.md lib/WebRtcPeer.js lib/browser.js lib/index.js test/WebRtcPeer.js test/_common.js
Fatal error: Arguments to path.resolve must be strings

thanks

You are welcome :-)

@piranna
Copy link
Author

piranna commented May 29, 2015

Some of my colleages that don't have the package.json entry on the jsdoc are having the same problem, too.

@krampstudio
Copy link
Owner

Could you also give me the value of paths in the same file, and do you have jsdoc installed globally ?
Then I'll fix the lookup method (as soon as I'm able to reproduce the issue).

@piranna
Copy link
Author

piranna commented May 29, 2015

Could you also give me the value of paths in the same file,

        //check first the base path into the cwd
        paths = [
            __dirname + '/../../node_modules/.bin/jsdoc',
            __dirname + '/../../node_modules/jsdoc/jsdoc.js'
        ];

I didn't touched it, anyway...

and do you have jsdoc installed globally ?

No, I don't, I've used the one that grunt-jsdoc installed.

Then I'll fix the lookup method (as soon as I'm able to reproduce the issue).

Ok, thank you. You could be able to reproduce by downloading the project code and upgrading the grunt-jsdoc dependency by hand.

@krampstudio
Copy link
Owner

:) I meant the value of the variable at runtime... but anyway with your project I'll try to reproduce the issue.
BTW your project seems interesting !

@krampstudio
Copy link
Owner

For now you can make it work by updating your config:

    jsdoc: {
      all: {
        src: ['README.md', 'lib/**/*.js', 'test/*.js'],
        options : {
            destination: 'doc/jsdoc'
        }
      }
    },

@krampstudio
Copy link
Owner

0.6.7 should fix it anyway

@piranna
Copy link
Author

piranna commented Jun 1, 2015

Yes, 0.6.7 has fixed it, thank you for doing it so quick! :-)

@krampstudio
Copy link
Owner

Cool!

@piranna
Copy link
Author

piranna commented Jun 1, 2015

👍

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

2 participants