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

Why does typedoc foo.ts report Error: Unable to find any entry points #2080

Closed
Gallaecio opened this issue Oct 19, 2022 · 2 comments
Closed
Labels
question Question about functionality

Comments

@Gallaecio
Copy link

$ typedoc --version

TypeDoc 0.22.15
Using TypeScript 4.6.4 from /usr/lib/node_modules/typedoc/node_modules/typescript/lib

$ typedoc --help
Usage:
  typedoc path/to/entry.ts
…
$ echo "export class Foo {}" > foo.ts
$ typedoc foo.ts 
Warning: Unable to locate entry point: <working directory>/foo.ts
Error: Unable to find any entry points. Make sure TypeDoc can find your tsconfig

Why is this minimal example not working? Is foo.ts not a valid “entry point”?

@Gallaecio Gallaecio added the question Question about functionality label Oct 19, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 19, 2022

TypeDoc requires a tsconfig file that includes your entry point - tsc doesn't need one, but I haven't spent the time figuring out how to match its behavior for this case.

@Gallaecio
Copy link
Author

Gallaecio commented Oct 19, 2022

Should it work if I specify the entry point with a command-line switch?

$ typedoc --entryPoints foo.ts foo.ts

Because, while it does not fail, it instead hangs indefinitely.

This alternative syntax fails as the original one:

$ typedoc --entryPoints foo.ts
Warning: Unable to locate entry point: <working directory>/foo.ts
Error: Unable to find any entry points. Make sure TypeDoc can find your tsconfig

But yes, it does work if I create tsconfig.json:

$ echo '{"entryPoints": ["foo.ts"]}' > tsconfig.json
$ typedoc foo.ts
Warning: The --name option was not specified, and no package.json was found. Defaulting project name to "Documentation".
Info: Documentation generated at ./docs

Thank you!

I consider my question solved, though I think the documentation may need an update if tsconfig.json is a required file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

2 participants