plsql-md-doc icon indicating copy to clipboard operation
plsql-md-doc copied to clipboard

TypeError: Path must be a string. Received undefined

Open martindsouza opened this issue 8 years ago • 3 comments

Getting the following error:

Created TOC
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1146:7)
    at Object.pmd.generateToc (/Users/giffy/Documents/GitHub/oraopensource/plsql-md-doc/lib/pmd.js:711:62)
    at Object.<anonymous> (/Users/giffy/Documents/GitHub/oraopensource/plsql-md-doc/app.js:91:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

martindsouza avatar Jul 29 '17 04:07 martindsouza

Could this be related to config.toc.menuTemplate ? Is it being checked in app.js and does it need to be in config.json?

rimblas avatar Jul 29 '17 04:07 rimblas

@rimblas yes looking at cleaning it up now. Will need @RamonEsteveCuevas to document it.

martindsouza avatar Jul 29 '17 04:07 martindsouza

@RamonEsteveCuevas it turns out there was more too it than just uncommenting one feature. I've reverted the past two PRs (git revert -m 1 -n e902a5010..master).

@rimblas and I were looking at the code and it looks like some testing needs to be done to support backwards compatibility (I think around this TOC search function). So some if statements will be required but also had issues with the list in Handlebars.

To help this is my current configuration that should work / be supported:

"oos-utils" : {
    "debug" : true,
    "folders" : {
      "output" : {
        "delete" : true,
        "path" : "/Users/giffy/Documents/GitHub/oraopensource/oos-utils/docs"
      },
      "source" : {
        "path" : "/Users/giffy/Documents/GitHub/oraopensource/oos-utils/source/packages",
        "fileFilterRegexp" : "\\.pk(b|s)$"
      },
      "template" : "/Users/giffy/Documents/GitHub/oraopensource/plsql-md-doc/templates/package.md"
    },
    "toc" : {
      "fileName" : "README.md",
      "template" : "/Users/giffy/Documents/GitHub/oraopensource/plsql-md-doc/templates/toc.md"
    }
  }

martindsouza avatar Jul 29 '17 05:07 martindsouza