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

Error: Unexpected end of input #92

Open
robtarr opened this issue Mar 22, 2016 · 4 comments
Open

Error: Unexpected end of input #92

robtarr opened this issue Mar 22, 2016 · 4 comments

Comments

@robtarr
Copy link

robtarr commented Mar 22, 2016

I have a project that i Just started a couple of months ago, and set up jsdox. I just made some changes, and recently upgraded to Node 4.3.1 (not sure if that is causing the problem). But when I try to run jsdox now, I get:

Error generating docs for file featurama-client.js [SyntaxError: Unexpected end of input]
[SyntaxError: Unexpected end of input]
/Users/Rob/projects/featurama/node_modules/jsdox/jsdox.js:300
            throw err;
            ^

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at jsdocParser._onComplete (/Users/Rob/projects/featurama/node_modules/jsdox/node_modules/jsdoc3-parser/index.js:37:19)
    at ChildProcess.exithandler (child_process.js:204:7)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

This is the file I'm running it on is this:

module.exports = function() {
  var list = {};

  /**
   *  Enable the indicated feature
   *
   *  @param    {String} featureName
   */
  function on(featureName) {
    list[featureName] = true;
  }

  /**
   *  Disable the indicated feature
   *
   *  @param    {String} featureName
   */
  function off(featureName) {
    list[featureName] = false;
  }

  /**
   *  Return the on/off status of the indicated feature
   *
   *  @param    {String} featureName
   */
  function enabled(featureName) {
    return list[featureName];
  }

  return {
    init: _buildList,
    on: on,
    off: off,
    enabled: enabled
  };
}();

It seems like deleting any line of code from this snippet (I've already ripped out some) fixes the problem. This, however, is not a very good solution. :)

I've traced it back to line 17 of jsdoc3-parser, and I've tried to play with the maxBuffer size, but have not had any luck.
execFile(cmd, ['-X', filename], { maxBuffer: 5120 * 1024 }, jsdocParser._onComplete.bind(null, cb));

@mrjoelkemp
Copy link
Contributor

Thanks for filing the issue. Here are a few questions that might help
troubleshoot the issue:

  • Does it work with a previous node version?
  • Does it work with a newer node version?
  • Can you revert your file changes and test?

It doesn't seem like a library issue at first glance.

On Mon, Mar 21, 2016 at 11:28 PM, Rob Tarr [email protected] wrote:

I have a project that i Just started a couple of months ago, and set up
jsdox. I just made some changes, and recently upgraded to Node 4.3.1 (not
sure if that is causing the problem). But when I try to run jsdox now, I
get:

Error generating docs for file featurama-client.js [SyntaxError: Unexpected end of input]
[SyntaxError: Unexpected end of input]
/Users/Rob/projects/featurama/node_modules/jsdox/jsdox.js:300
throw err;
^

SyntaxError: Unexpected end of input
at Object.parse (native)
at jsdocParser._onComplete (/Users/Rob/projects/featurama/node_modules/jsdox/node_modules/jsdoc3-parser/index.js:37:19)
at ChildProcess.exithandler (child_process.js:204:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:821:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)```

This is the file I'm running it on is this:

module.exports = function() {
var list = {};

/**

  • Enable the indicated feature *

    @param https://github.com/param {String} featureName
    */
    function on(featureName) {
    list[featureName] = true;
    }

    /**

  • Disable the indicated feature *

    @param https://github.com/param {String} featureName
    */
    function off(featureName) {
    list[featureName] = false;
    }

    /**

  • Return the on/off status of the indicated feature *

    @param https://github.com/param {String} featureName
    */
    function enabled(featureName) {
    return list[featureName];
    }

    return {
    init: _buildList,
    on: on,
    off: off,
    enabled: enabled
    };
    }();

It seems like deleting any line of code from this snippet (I've already ripped out some) fixes the problem. This, however, is not a very good solution. :)

I've traced it back to line 17 of jsdoc3-parser, and I've tried to play with the maxBuffer size, but have not had any luck.
execFile(cmd, ['-X', filename], { maxBuffer: 5120 * 1024 }, jsdocParser._onComplete.bind(null, cb));


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#92

@robtarr
Copy link
Author

robtarr commented Mar 22, 2016

  • It does work in 0.12
  • It does not work in 4.3.1 or 5.7.0
  • It does not work with the reverted changes

Would love any insight into this. Is anybody else using this with 4.3.1?

@mrjoelkemp
Copy link
Contributor

Thanks for the info! We should add those node versions to the travis config
to see what fails.
On Mar 22, 2016 9:32 AM, "Rob Tarr" [email protected] wrote:

  • It does work in 0.12
  • It does not work in 4.3.1 or 5.7.0
  • It does not work with the reverted changes


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#92 (comment)

@psq
Copy link
Contributor

psq commented Mar 22, 2016

I ran jsdox on the code provided in the first comment on this thread, but did not get any errors (using node 5.9.0).

As the build is working fine on Travis, I suspect there may be some encoding issues with your original file. And as just removing lines randomly also helps, it may be just that re-saving fixes the encoding.

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

3 participants