-
Notifications
You must be signed in to change notification settings - Fork 15
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
"There are no input files to process" error from explainSync() #19
Comments
Hi, there's not enough context in your report - could you post a reproduction case I can run and see the issue please? You don't need to include a call to the Github API, just include the string you are passing into Also, which version of node and jsdoc-api are you using? Which OS? |
I am using version 5.0.3 of jsdoc-api, and version 10.16.0 of node. I am developing on a Mac with the Mojave OS. The string I am passing into options.source is the contents of a webdriverIO test file. I cannot provide the exact test file as the code is proprietary, but here is the gist of what it looks like:
As for the value of |
I'm sorry, I can't reproduce your issue. On node v10 on macOS I get the expected output. This is the reproduction case I ran: const jsdocApi = require('jsdoc-api')
const source = `const viewport = browser.options.formFactor;
const { URLS } = require('constants');
const button = '#button-1';
const errorView = '.error-view';
// FUTURE: TASK-NUM - Remove this
const ignoredA11y = { 'color-contrast': { enabled: false } };
/**
* Requirements tested
*/
describe('Workflows', () => {
/**
* @name test
* @traces 2390829304
* @traces 12091290123
* @describe Description
*/
describe('Description', () => {
before(() => {
browser.url(URLS.URL);
browser.refresh();
browser.waitForEnabled(button);
browser.click(button);
browser.waitForVisible(errorView);
});
Thing.should.matchScreenshot();
Thing.should.beAccessible({ viewport, rules: ignoredA11y });
it('does ' +
'stuff', () => {
browser.click(button);
browser.waitForVisible(errorView);
expect(browser.getText('text')).to.contain('text');
});
Thing.should.matchScreenshot();
Thing.should.beAccessible();
});
describe('Description 2', () => {
before(() => {
browser.url(URLS.URL);
browser.refresh();
});
it('does stuff 2', () => {
expect(browser.getText('text')).to.contain('text');
});
Thing.should.matchScreenshot();
Thing.should.matchScreenshot();
});
});`
const documentationBlocks = jsdocApi.explainSync({ source });
console.log(documentationBlocks)
// correct output is printed I suspect your issue might not be directly related to jsdoc-api. |
Please post some code which fails every time on your system. Please post the full script, not just snippets - I need a reproduction case, a complete script (like what I posted above) that can be run as supplied. I don't need to see all your propritary file content, just example file content would be enough so long as it fails every time, highlighting the issue. |
I actually just ran the exact reproduction case that you responded with and got the same error. |
that's odd.. could you try uninstalling then reinstalling all your deps please? |
I think I found the problem. The problem that I was having is that on my computer, the name of the folder that the temporary file was placed into started with an underscore. The default options of JSDoc are to exclude folders and files that begin with an underscore. A workaround to fix the issue was to create a JSDoc configuration file that allowed files and folders to begin with an underscore, and then pass that as the "configure" option to the API. A recommendation would be to possibly override the exclude pattern by default. |
oh, i see! So your system temp dir begins with an underscore? You can view your tmpdir like this on the node REPL:
I don't know how system tmp dirs are named but if there is a possibility of them beginning with |
Right, this is what that path to the temporary file looked like: /var/folders/_9/nl_3vwh14lx9325r9cn6s08s96pd8g/T/mgyzm6w9alb582old8pnle.js I think it just so happened that after the last reboot of my computer, it started having an underscore in that folder name. But the name should change every time you reboot your system, so that's probably why it was working for me in the past. |
I searched the jsdoc repo and found several issues caused by this leading underscore behaviour, but they were all closed without resolution. I've opened a new issue and will let you know if I hear anything back. If I don't hear anything back I'll consider a different fix. Thanks for your patience with this, let me know if you find anything else. |
I can confirm this issue as well in macOS Catalina. Thank you for the workaround @juliacalandro you saved me hours of debugging! <3 And thank you @75lb for your good work! |
We had to implement the workaround since we can't wait for the issue to be solved from the jsdoc team. |
JSDoc was [failing](jsdoc2md/jsdoc-api#19) while attempting to read a temp file written to a directory beginning with an underscore. This resulted in several docs being marked as "uncategorized" and appearing at the root level of the sidebar navigation in the docs app. This fix overwrites the default configuration for JSDoc, as documented [here](https://jsdoc.app/about-configuring-jsdoc.html) TEST PLAN: - Load the docs and make sure no docs appear at the root level of the sidebar navigation - Make sure docs appear under the "Utilities" menu item, and nested properly under sub-categories. Closes: INST-2696 Change-Id: Id2ae089063a0949e42cb3c62330ce8d64e470b3a Reviewed-on: https://gerrit.instructure.com/c/instructure-ui/+/244179 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Bence Toppanto <bence.toppanto@instructure.com> QA-Review: Daniel Sasaki <dsasaki@instructure.com> Product-Review: Chris Guerrero <cguerrero@instructure.com> Visual-Regression-Test: Chris Guerrero <cguerrero@instructure.com>
Increase the child_process maxBuffer to 100MB #24
Gave up waiting for jsdoc, workaround implemented and released in v9.1.0. Let me know if you find anything else 👍 |
I am attempting to pass file contents that I retrieved by calling the GitHub API into explainSync. When I was previously reading a local file using
fs.readFileSync(<file_path>).toString()
and passing this into explainSync, it worked. However, now when I am doing the following, I get the error "There are no input files to process".I verified that
sourceCode
is a string that contains the contents of the file that I wish to parse the documentation of.I have also tried passing in a plain string to explainSync without creating a Buffer and converting it to a string, and the plain string approach gives the same error.
Does anyone know of a solution to fix this?
The text was updated successfully, but these errors were encountered: