-
Notifications
You must be signed in to change notification settings - Fork 712
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
JSDoc @typedef yields ERR_ASSERTION in convertTypeAlias #1437
Comments
This is unfortunately expected right now, we need special casing for JSDoc type nodes because the compiler doesn't convert them into normal type nodes - #1214. There is a workaround - set |
Thanks for the prompt answer! Hmm… I've tried that but I get
(I've updated it to actually export a function which uses the defined type but still get the same error. I've also tried removing |
So... I started debugging that, then decided to take a second look at how difficult supporting |
Wow! I appreciate that so much! I was considering switching to pure TS instead of JSDoc style, but I'll give this another shot. I'm glad to keep poking at this, file issues, and get involved in more substantial debugging, but I also totally respect if that would be pushing what it supports in a direction that you're not that interested in investing. I'll give it a shot, but please don't hesitate to or feel bad about responding that it's just not particularly interesting to you if that's the case. Thanks again and happy new year! 🎉 |
Hi @rreusser, does this work for you now? I'm trying to generate TypeDoc types from a pure-js project (with Typescript JSDoc type definitions). Typescript creates my
UPDATE: Ah, nevermind! It turns out my problem was that Typescript adds the value of |
Search terms
ERR_ASSERTION
,@typedef
,jsdoc
Expected Behavior
Expected to compile a minimal example using a JSDoc
@typedef
statement.Actual Behavior
Fails an assertion in
convertTypeAlias
.Assertion failure output...
Steps to reproduce the bug
See minimal repro here: https://github.com/rreusser/typedoc-repro
A single JSDoc statement copied verbatim from this example is sufficient to cause the error:
/** @typedef {Object} SpecialType - creates a new type named 'SpecialType' */
I'm new to TypeScript, so please forgive any obvious errors, but it seems like this is minimal enough that I believe it should be valid usage.
tsc
runs and produces the expected output. It looks like this project is moving quickly at the moment (thanks soo much for your effort! This is a great project! ❤️), so it seemed to meet the threshold of reporting.Environment
v0.20.5
4.1.3
15.5.0
The text was updated successfully, but these errors were encountered: