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

[Bug] using an index.js file in source generate an error when runing vuepress build folder #2

Closed
HenryTabima opened this issue Nov 28, 2018 · 5 comments

Comments

@HenryTabima
Copy link
Contributor

I configure my package json script like this:

{
...
  "scripts": {
    "docs:gen": "vuepress-jsdoc --source=./src --dist=./docs --title=API",
    "docs:build": "vuepress build docs"
  },
...
}

i was testing and i had an index.js file in src folder. npm run docs:gen work fine, but when running npm run docs:build I got this error:

FAIL  Error rendering /code/:
TypeError: Cannot read property 'match' of undefined
...
@ph1p
Copy link
Owner

ph1p commented Nov 29, 2018

I'll check it out ;)

@ph1p
Copy link
Owner

ph1p commented Nov 29, 2018

Hey @HenryTabima ! I've updated the example. Please take a look at it, maybe you've forgotten something at your documentation.
Please send me your folder structure, if the error is not gone + version numbers of all dependencies (vuepress etc.)

@HenryTabima
Copy link
Contributor Author

i just pushed the test project to this Repo. to reproduce the error, just change the name of main.js to index.js in the src directory. Then run npm run docs:gen and npm run doc:build

@HenryTabima
Copy link
Contributor Author

I guess it happens because of the default behavior of vuepress with index files and the README.md created in the project.

# vuepress-jsdoc index.js
...
  // create README.md
  await fs.writeFile(`${docsFolder}/README.md`, `Welcome`);
...

@ph1p ph1p reopened this Nov 30, 2018
ph1p added a commit that referenced this issue Nov 30, 2018
@ph1p
Copy link
Owner

ph1p commented Nov 30, 2018

Fixed. Now you can also add a custom title with the new @vuepress comment block.

@ph1p ph1p closed this as completed Nov 30, 2018
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