Skip to content

Commit

Permalink
fix: handle parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 9, 2021
1 parent 40c8e16 commit b942424
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 113 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"release": "yarn standard-version && git push --follow-tags origin main && npm publish"
},
"dependencies": {
"@nuxt/kit": "npm:@nuxt/kit-edge",
"@nuxt/kit": "npm:@nuxt/kit-edge@latest",
"pathe": "^0.2.0",
"scule": "^0.2.1",
"vue-docgen-api": "^4.41.2"
Expand Down
9 changes: 8 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ export default defineNuxtModule({
nuxt.hook('components:extend', async (components: any[]) => {
const _components = await Promise.all(
components.map(async (component: any) => {
const data = await parse(component.filePath)
let data
try {
data = await parse(component.filePath)
} catch (e) {
// eslint-disable-next-line no-console
console.error(`Cannot parse "${component.pascalName}".`, e)
data = {}
}
return {
name: component.pascalName,
description: data.description,
Expand Down
Loading

0 comments on commit b942424

Please sign in to comment.