You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered this bug when used vue-intellisense which uses vue-docgen-api
Current behavior
It crashes with error
TypeError: Cannot read properties of undefined (reading 'length')
at NodePath.each (/Users/disorder/Projects/PP/uikit/node_modules/recast/node_modules/ast-types/lib/path.js:72:30)
at NodePath.filter (/Users/disorder/Projects/PP/uikit/node_modules/recast/node_modules/ast-types/lib/path.js:100:14)
at /Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:161:50
at step (/Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:52:23)
at Object.next (/Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:33:53)
at /Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:27:71
at new Promise (<anonymous>)
at __awaiter (/Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:23:12)
at /Users/disorder/Projects/PP/uikit/node_modules/vue-docgen-api/dist/script-handlers/propHandler.js:107:99
at Array.map (<anonymous>)
To reproduce
import{defineComponent,PropType}from'vue';typePPIconType='name1'|'name2';exportdefaultdefineComponent({name: 'test',props: {icon: StringasPropType<PPIconType>,// <--- This is valid Vue syntax, but docgen is not working// icon: {// type: String as PropType<PPIconType>, // <--- This is OK// },}})
Expected behavior
It should not crash obviously and work like you wrapped type in object
The text was updated successfully, but these errors were encountered:
Disorrder
changed the title
PropType<T> crashes if not used in prop.type field
vue-docgen-api: PropType<T> crashes if not used in prop.type field
Jan 11, 2022
Discovered this bug when used vue-intellisense which uses
vue-docgen-api
Current behavior
It crashes with error
To reproduce
Expected behavior
It should not crash obviously and work like you wrapped type in object
The text was updated successfully, but these errors were encountered: