better-docs icon indicating copy to clipboard operation
better-docs copied to clipboard

"Cannot read property 'filePath' of undefined" error for Vue files

Open leosdad opened this issue 4 years ago • 2 comments

I'm trying to use better-docs for Vue files, but I always get the following: TypeError: Cannot read property 'filePath' of undefined. Here is a copy of my jsdoc.json:

{
  "source": {
    "include": [
      "src",
      "dev"
    ],
    "includePattern": ".+\\.(js|vue)(doc|x)?$",
    "excludePattern": "(^|\\/|\\\\)_"
  },
  "sourceType": "module",
  "opts": {
    "destination": "jsdoc_html",
    "recurse": true,
    "private": true,
    "readme": "./doc.md",
    "template": "node_modules/better-docs"
  },
  "tags": {
    "allowUnknownTags": [
      "component"
    ]
  },
  "plugins": [
    "node_modules/better-docs/component"
  ]
}

Restoring the include pattern to ".+\\.js(doc|x)?$" does not give any errors.

Thanks in advance,

leosdad avatar Jul 17 '20 17:07 leosdad

can you paste the component which causes the error (maybe it is related to the issue where better-docs doesn't support module aliases like import '@src/my-file.vue')

wojtek-krysiak avatar Jul 24 '20 08:07 wojtek-krysiak

I've already switched back to JSDoc because I couldn't produce any results with better-docs. As for the cause, you're probably right because most of my Vue components have '@'-like imports.

leosdad avatar Jul 24 '20 12:07 leosdad