better-docs icon indicating copy to clipboard operation
better-docs copied to clipboard

Can't build docs when using the component plugin

Open kylekirkby opened this issue 4 years ago • 6 comments

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_modules and re-installing with yarn install
  • Installing the latest parcel-bundler globally.

kylekirkby avatar Mar 19 '21 15:03 kylekirkby

parcel 2.0.0 uses --dist-dir instead of --out-dir @

this pull request fixes it: https://github.com/SoftwareBrothers/better-docs/pull/157

pdgago avatar May 27 '21 17:05 pdgago

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?

rchancey avatar Oct 06 '21 21:10 rchancey

Same here, overriding the bundle.js command did the trick. Thanks @pdgago !

fabiendeborde avatar Dec 27 '21 18:12 fabiendeborde

Hy @FabienDeborde Can you till me how you fixed the issue because i am having the same issue

kunalkumar007 avatar Sep 21 '22 17:09 kunalkumar007

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'

PabloPenia avatar Sep 26 '22 04:09 PabloPenia

just fix it removing and reinstalling parcel:

yarn global remove parcel parcel-bundler
yarn global add parcel

PabloPenia avatar Sep 26 '22 04:09 PabloPenia