Closed Ashimriat closed 3 years ago
This doesn't seem to have anything to do with the exclude
option. Excluding node_modules
in your tsconfig does not mean that files it in will not be considered when compiling for types. It means that those files will not be compiled and produce .js output.
You will see the same errors if you compile with npx tsc -p tsconfig.json
. Having both Vue and React types installed is causing problems since they have conflicting types. If you set the skipLibCheck option, TypeScript will ignore errors in node_modules and TypeDoc will be able to execute.
Builds without any problems now! Thank you very much ^^
Search terms
exclude, bug
Expected Behavior
I have a project on Typescript which correctly builds and launches I expect for Typedoc to generate documentation for specified file correctly
Actual Behavior
Documentation build fails with following errors:
Steps to reproduce the bug
package.json
```json { "scripts": { "dev:server": "webpack serve --mode=development", "prod:build": "webpack --mode=production", "test": "jest --config=.jestrc.js --no-cache", "test:snapshotsUpdate": "run test -- -u", "test:coverage": "test -- --coverage=true", "docs": "jsdoc -c .jsdocrc.js -r", "docsTs": "typedoc --options .typedocrc.js", "storyServ": "start-storybook -p 6006 -c storybook --no-manager-cache", "storyBuild": "build-storybook -c storybook" }, "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/vue-fontawesome": "^3.0.0-4", "reflect-metadata": "^0.1.13", "vue": "^3.1.1", "vue-property-decorator": "^10.0.0-rc.3", "vuex": "^4.0.2", "vuex-class-modules": "^1.3.0" }, "devDependencies": { "@babel/core": "^7.14.6", "@babel/node": "^7.14.7", "@babel/preset-env": "^7.14.7", "@storybook/addon-essentials": "^6.3.2", "@storybook/addon-links": "^6.3.2", "@storybook/addon-storyshots": "^6.3.2", "@storybook/builder-webpack5": "^6.3.2", "@storybook/cli": "^6.3.2", "@storybook/manager-webpack5": "^6.3.2", "@storybook/vue3": "^6.3.2", "@types/jest": "^26.0.23", "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", "@vue/compiler-sfc": "^3.1.1", "@vue/composition-api": "^1.0.0-rc.12", "@vue/test-utils": "^2.0.0-rc.8", "@yarnpkg/pnpify": "^3.0.0-rc.7", "babel-jest": "^26.6.3", "babel-loader": "^8.2.2", "better-docs": "^2.3.2", "copy-webpack-plugin": "^9.0.0", "css-loader": "^5.2.6", "eslint": "^7.29.0", "eslint-config-airbnb-typescript": "^12.3.1", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.3.6", "eslint-plugin-jsdoc": "^35.4.0", "eslint-plugin-vue": "^7.11.1", "eslint-webpack-plugin": "^2.5.4", "html-webpack-plugin": "^5.3.1", "jest": "^26.6.3", "jest-cucumber-fusion": "^0.8.1", "jest-serializer-vue": "^2.0.2", "jsdoc": "^3.6.7", "pnp-webpack-plugin": "^1.6.4", "pug": "^3.0.2", "pug-bem-plain-loader": "^1.1.5", "sass": "^1.25.0", "sass-loader": "^12.1.0", "stylelint": "^13.13.1", "stylelint-config-airbnb": "0.0.0", "stylelint-order": "^4.1.0", "stylelint-scss": "^3.19.0", "stylelint-webpack-plugin": "^2.2.1", "ts-jest": "^26.5.6", "ts-loader": "^9.2.3", "typedoc": "^0.21.2", "typescript": "^4.3.4", "vue-class-component": "^8.0.0-rc.1", "vue-eslint-parser": "^7.6.0", "vue-jest": "^5.0.0-alpha.10", "vue-loader": "^16.3.0", "vue-style-loader": "^4.1.3", "webpack": "^5.39.1", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2" } } ```tsconfig.json
```jsonc { "include": [ "src/**/*.vue", "src/**/*.ts", ], "exclude": [ "tools", "node_modules", "storybook", "tests" ], "files": [ "shims/vue.d.ts", "shims/vuex.d.ts", "shims/images.d.ts", ], "compilerOptions": { "baseUrl": "./", "outDir": "dist", "allowSyntheticDefaultImports": true, "declaration": true, "declarationDir": "dist/types", "esModuleInterop": true, "target": "esnext", "module": "esnext", "lib": ["esnext", "dom"], "strict": true, "jsx": "preserve", "sourceMap": true, "moduleResolution": "node", "experimentalDecorators": true, "allowJs": true, "paths": { "@jwe/utils": ["src/tools/utils.ts"], "@jwe/interfaces": ["src/tools/interfaces.ts"], "@jwe/*": ["src/*"] }, } } ```command used to run typedoc:
.typedocrc.js
```js module.exports = { name: 'Test Name', includeVersion: true, hideGenerator: true, excludeNotDocumented: true, entryPoints: [ 'src/store/modules/text.ts' ], exclude: [ 'shims/**/*.ts', ], externalPattern: [ 'node_modules/**/*.ts', ], excludeExternals: true, disableSources: true, media: 'src/assets', out: 'documentation', listInvalidSymbolLinks: true, readme: 'none', watch: true, } ```project structure:
currently tested code:
Environment