-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
7.6.3
Node.js version
18.x
MongoDB server version
6.0.x
Typescript version (if applicable)
Not using TypeScript
Description
While working on Mongoose documentation generation, I found that the docs parser crashes when a property does not contain the tags array.
In docs/source/api.js, the loop assumes prop.tags always exists.
However, in some parsed doc blocks, prop.tags is undefined, which causes a runtime error:
TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.iterator)')
The crash happens before documentation pages finish building.
Steps to Reproduce
-
Clone the mongoose repository
-
Install dependencies:
npm install -
Run the docs build script:
npm run docs:build -
Build fails with:
TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.iterator)')
at docs/source/api.js:XXX
Expected Behavior
The docs parser should safely skip properties without tags instead of crashing.
Documentation generation should complete without errors.