Skip to content

TypeError: Cannot read property 'flags' of undefined #298

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

Closed
jrf0110 opened this issue Sep 26, 2016 · 7 comments
Closed

TypeError: Cannot read property 'flags' of undefined #298

jrf0110 opened this issue Sep 26, 2016 · 7 comments

Comments

@jrf0110
Copy link

jrf0110 commented Sep 26, 2016

When I attempt to run the following code:

const { Application } = require('typedoc')
const app = new Application({ name: 'App' })

app.generateJson(['docs-entry.ts'], 'dist/docs.json')

I get the following Error:

typedoc/lib/converter/types/reference.js:26
        return !!(type.flags & 2588672);
                      ^

TypeError: Cannot read property 'flags' of undefined
    at ReferenceConverter.supportsNode (typedoc/lib/converter/types/reference.js:26:23)
    at Converter.convertType (typedoc/lib/converter/converter.js:127:31)
    at typedoc/lib/converter/nodes/class.js:47:63
    at Context.withScope (typedoc/lib/converter/context.js:99:9)
    at ClassConverter.convert (typedoc/lib/converter/nodes/class.js:35:17)
    at Converter.convertNode (typedoc/lib/converter/converter.js:117:53)
    at typedoc/lib/converter/nodes/block.js:71:33
    at Array.forEach (native)
    at BlockConverter.convertStatements (typedoc/lib/converter/nodes/block.js:69:29)
    at typedoc/lib/converter/nodes/block.js:55:27

Note: I am using Typescript 2.0.2

Any thoughts on this?

@jrf0110
Copy link
Author

jrf0110 commented Sep 26, 2016

Note, my project compiles just fine with the Typescript compiler

@blakeembrey
Copy link
Member

The codebase has not been updated to 2.0 yet. You're welcome to submit a PR or view existing issues/PRs trying to fix this.

@jrf0110
Copy link
Author

jrf0110 commented Sep 26, 2016

Ah, yes. I forgot I was using the fork provided by #290 - I should also note that compiling from the command line works just fine. As far as I can tell, the CLI is basically doing the same sorts of things that the above is performing, so I assumed it was an issue with this lib rather than the typescript version.

@blakeembrey
Copy link
Member

Honestly, I can't help but hopefully someone else can. I tried updating typedoc to 2.0 and logged my issues in that PR. It's possible some of the codebase has changed, I couldn't figure out how someone even got that branch to compile successfully unless it was based on an old TypeScript definition which would explain how a bug like this got through.

@jrf0110
Copy link
Author

jrf0110 commented Sep 26, 2016

Interesting!

Yeah, it took me a realllly long time to successfully setup TypeScript for my project. The only way I could get it to work was with 2.0. At first, TypeDoc was a complete non-starter because of lack of v2 support (typedoc should maybe allow passing in a specific tsc instance when used from the JS interface).

Luckily, everything is working from the CLI from #290's work.

@blakeembrey
Copy link
Member

Yes, that would be lovely. But impossible with the current architecture. I do work with peer dependencies on my other projects like ts-node. There's a bunch of issues asking for this, and as much I'd love to implement it, I'm not really working on this project and the current state is hoping for someone who will right now. But most commits are just drive-by commits. Consider this a request for yourself to submit a PR for it 😄

@blakeembrey
Copy link
Member

If you say #290 is working, does that mean this is a non-issue? I'm a little confused, sorry, but I thought it wasn't working?

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

2 participants