TypeError when using swagger-jsdoc with lint-staged installed
aruberutochan opened this issue · 1 comments
Describe the bug
Encountering a TypeError when trying to use the swagger-jsdoc
library in a project where lint-staged
is also installed. The error occurs during the execution of the project, specifically when building the Swagger specification files. The error does not appear when lint-staged
is uninstalled.
This is the error that i see:
/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/specification.js:187
YAML.defaultOptions.keepCstNodes = true;
^
TypeError: Cannot set properties of undefined (setting 'keepCstNodes')
at build (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/specification.js:187:36)
at module.exports (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/lib.js:32:10)
at Object.<anonymous> (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/src/index.ts:14:26)
To Reproduce the error with lint-staged
- Clone the repository from this link.
- Install dependencies using
npm install
. - Run the project with
npm start
. - You should see the error in the terminal.
No error after removing lint-staged
- Clone the repository from this link.
- Install dependencies using
npm install
. - Remove lint-staged using
npm remove lint-staged
- Run the project with
npm start
. - You should see the log in the terminal with the generated documentation in json.
Expected behavior
The project should start without errors when using the lint-staged library, and the Swagger documentation should be built successfully.
Desktop:
- OS: Pop!_OS 22.04 LTS
- Node version:
v20.9.0
- npm version:
10.2.24
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.