Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The "path" argument must be of type string #3

Open
Worie opened this issue Jun 23, 2018 · 3 comments
Open

Error: The "path" argument must be of type string #3

Worie opened this issue Jun 23, 2018 · 3 comments

Comments

@Worie
Copy link

Worie commented Jun 23, 2018

Hi, just wanted to try your package - it seems like a really handy tool! However, I've got some troubles using it. I've installed it, added it to dependencies, added a script to run it - and my README.md file has ## API section that could be replaced with the contents generated from docts.

However, I seem to have a problem with generatc the content. Perhaps you could have a look and point me to the solution? I'm not sure whether I've an issue with the structure of my app or its something else.

If you want, you can see my current setup where it occurs here: btt-node

path.js:28
    throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'path', 'string');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1184:7)
    at new DocBuilder (btt-node/node_modules/docts/dist/DocBuilder.js:37:29)
    at Object.patchReadme (btt-node/node_modules/docts/dist/Patcher.js:19:9)
    at Object.<anonymous> (btt-node/node_modules/docts/dist/cli.js:6:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (btt-node/node_modules/docts/bin/docts:3:1)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)

Thanks in advance!

@bschlenk
Copy link
Contributor

bschlenk commented Sep 9, 2018

I am also seeing this. It looks like it is because docts assumes a typings field will be present in package.json:

this.dtsPath = path.resolve(basePath, pkgJson.typings);

But typescript now supports types also, which people mostly use now. This should be updated to use whichever one it finds first.

@bschlenk
Copy link
Contributor

Should be fixed by 68a576c.

@jjrv
Copy link
Member

jjrv commented Sep 11, 2018

Thank you so much for the report and PR!

I'm working on supporting TypeScript 3 and will release soon, at least with this issue fixed.

@jjrv jjrv closed this as completed Sep 11, 2018
@jjrv jjrv reopened this Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants