esdoc-plugins
esdoc-plugins copied to clipboard
TypeError: Cannot read property 'kind' of undefined when using 'esdoc-jsx-plugin'
It looks like that using "esdoc-jsx-plugin" broke esdoc with the following message:
TypeError: Cannot read property 'kind' of undefined
at SearchIndexBuilder._getOutputFileName (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Builder/DocBuilder.js:585:17)
at SearchIndexBuilder._getOutputFileName (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Builder/DocBuilder.js:598:23)
at SearchIndexBuilder._getURL (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Builder/DocBuilder.js:570:29)
at SearchIndexBuilder.exec (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Builder/SearchIndexBuilder.js:52:20)
at Plugin._exec (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Plugin.js:97:66)
at Plugin.onPublish (/[.....whatever.....]/node_modules/esdoc-publish-html-plugin/out/src/Plugin.js:71:10)
at Plugin._execHandler (/[.....whatever.....]/node_modules/esdoc/out/src/Plugin/Plugin.js:55:26)
at Plugin.onPublish (/[.....whatever.....]/node_modules/esdoc/out/src/Plugin/Plugin.js:154:10)
at Function._publish (/[.....whatever.....]/node_modules/esdoc/out/src/ESDoc.js:354:24)
at Function.generate (/[.....whatever.....]/node_modules/esdoc/out/src/ESDoc.js:149:10)
Here is my config:
module.exports = {
source: './src',
destination: './docs',
includes: ['\\.(js|jsx)'],
excludes: ['\\.config\\.js$', 'utils'],
plugins: [
{ name: 'esdoc-standard-plugin' },
{ name: 'esdoc-flow-type-plugin' },
{ name: 'esdoc-jsx-plugin' },
{ name: 'esdoc-react-plugin' },
{ name: 'esdoc-coverage-plugin' },
],
};
if I comment this line from the plugins' array: { name: 'esdoc-jsx-plugin' }
it work properly but no .jsx file were included.
Unfortunately, I am documenting a React app 😄
Sorry, I forgot the package.json:
"dependencies": {
"autoprefixer": "^8.0.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"css-loader": "^0.28.5",
"extract-text-webpack-plugin": "^3.0.0",
"favicons-webpack-plugin": "0.0.7",
"file-loader": "^1.1.11",
"glob": "^7.1.2",
"history": "^4.7.2",
"html-webpack-plugin": "^3.0.4",
"node-sass": "^4.5.3",
"postcss-loader": "^2.0.6",
"purify-css": "^1.2.6",
"purifycss-webpack": "^0.7.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"sass-loader": "^6.0.6",
"style-loader": "^0.20.2",
"uglifyjs-webpack-plugin": "^1.2.2",
"url-loader": "^0.6.2",
"webpack": "^3.10.0",
"whatwg-fetch": "^2.0.3"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-jest": "^22.4.1",
"babel-plugin-module-resolver": "^3.1.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"esdoc": "^1.0.4",
"esdoc-coverage-plugin": "^1.1.0",
"esdoc-flow-type-plugin": "^1.0.1",
"esdoc-jsx-plugin": "^1.0.0",
"esdoc-react-plugin": "^1.0.1",
"esdoc-standard-plugin": "^1.0.0",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-import-resolver-webpack": "^0.8.4",
"eslint-loader": "^2.0.0",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsdoc": "^3.5.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.1.0",
"flow-bin": "^0.66.0",
"flow-webpack-plugin": "^1.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.4.2",
"react-hot-loader": "^4.0.0",
"react-test-renderer": "^16.2.0",
"redux-devtools-extension": "^2.13.2",
"redux-mock-store": "^1.5.1",
"regenerator-runtime": "^0.11.1",
"webpack-dev-server": "^2.9.5"
}
Hey, sorry I can't directly address the issue you are having but I did spot a small bug in your config.
includes: ['\\.(js|jsx)'],
should be includes: ['\\.(js|jsx)$'],
with the dollar symbol at the end, otherwise esdoc will try to parse .json files and potentially other stuff that has .js
or .jsx
anywhere in it's name. e.g. file.jslip.png
Also I found the esdoc has a tendency to go into my node_modules folder which was causing issues for me, probably wouldn't hurt to add 'node_modules'
to your exlcudes as well.