better-docs
better-docs copied to clipboard
Can't build docs when using the component plugin
If I enabled the component plugin I'm getting the following when attempting to build the docs:
jsdoc -c jsdoc.confg.json
$ jsdoc -c jsdoc.conf.json
Generating entry file for "components" plugin
Bundling components
running: NODE_ENV=development parcel build docs/entry.js --out-dir docs/build
🚨 /home/god/Git/xxxxxxxx/docs/entry.js: Cannot resolve dependency '/home/god/Git/xxxxxxxx/node_modules/@babel/runtime/helpers/interopRequireDefault' at '/home/god/Git/xxxxxxxx/node_modules/@babel/runtime/helpers/interopRequireDefault'
at Resolver.resolve (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/Resolver.js:71:17)
at async Bundler.resolveAsset (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:433:18)
at async Bundler.resolveDep (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:484:14)
at async /home/god/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:608:26
at async Promise.all (index 2)
at async Bundler.loadAsset (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async Bundler.processAsset (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:557:5)
at async PromiseQueue._runJob (/home/god/.config/yarn/global/node_modules/parcel-bundler/src/utils/PromiseQueue.js:48:7)```
My current config:
```json
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
},
"source": {
"include": ["src"],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": ["plugins/markdown", "node_modules/better-docs/component"],
"templates": {
"better-docs": {
"name": "My React components"
}
},
"opts": {
"destination": "docs",
"recurse": true,
"template": "node_modules/better-docs",
"readme": "README.md"
}
}
Things I've tried:
- Removing
node_modulesand re-installing withyarn install - Installing the latest
parcel-bundlerglobally.
parcel 2.0.0 uses --dist-dir instead of --out-dir @
this pull request fixes it: https://github.com/SoftwareBrothers/better-docs/pull/157
I am getting this as well.. months later.. Generating entry file for "components" plugin Bundling components running: NODE_ENV=development parcel build www/entry.js --out-dir www/build /bin/sh: parcel: command not found
/Users/raphaelchancey/immuno-oncology-advisor/docs/node_modules/better-docs/bundler.js:91 throw error ^
Error: Command failed: NODE_ENV=development parcel build www/entry.js --out-dir www/build /bin/sh: parcel: command not found any update?
Same here, overriding the bundle.js command did the trick. Thanks @pdgago !
Hy @FabienDeborde Can you till me how you fixed the issue because i am having the same issue
I'm having same issue tryed yarn add global parcel and yarn add global parcel-bundler, same issue:
Bundling components
running: NODE_ENV=development parcel build docs/jsdoc/entry.js --dist-dir docs/jsdoc/build
error: unknown option `--dist-dir'
just fix it removing and reinstalling parcel:
yarn global remove parcel parcel-bundler
yarn global add parcel