-
Notifications
You must be signed in to change notification settings - Fork 510
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
GenerateMetadataError: Unknown type: IndexedAccessType #1622
Comments
Hello there douglasg14b 👋 Thank you for opening your very first issue in this project. We will try to get back to you as soon as we can.👀 |
Oh, found another, is this the same problem? I see other issues like this that appear to be solved 🤔 Indexed types like this make up a majority of any typings we have when it comes to configuration or definitions. It's almost impossible to avoid index types through the entire type tree as they are a fundamental part of most TS usage. Is there any particular reason that: |
Hm, this is actually causing a lot of pain at multiple layers, I wonder how to work around it. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Bad bot. How to speedrun fragmented information & hidden problems 101. |
Would you like to submit a PR to fix this issue? |
@WoH I actually went through and tried to understand how this works, and honestly submitting a PR for this is quite the task since I have no context on the codebase, and there isn't much in the way of guidance on the decisions that have been made, or how to navigate them. There's cruft, but not much that explains it, where to look, how things are put together, why various "things" are the way they are, resources...etc I'm guessing that's a 10-40h task, or even longer. Someone who is already familiar with how TSOA is put together, and has this context may be able to do this in just a few hours. At the very minimum, someone knowledgeable should provide design guidance, learning resources, and other information to get someone started on this problem. |
Sure, I can give you some guidance: The first step is to debug this construction by both the Parser, as well as the information the type checker provides. These are the 2 possible sources, TS has some information on both of these here: https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API To quickly visualize the AST, this is a great tool: IIRC there's a TS discord channel where you can probably also ask for help w/r/t making sense of the Type you want to convert. Then, tsoa is actually pretty simple, once you understand the idea. We go though all the class declarations with a Controller Annotation and work through them.
E: In your case, take a look around here: https://github.com/lukeautry/tsoa/blob/master/packages/cli/src/metadataGeneration/typeResolver.ts#L454 |
@WoH Dumb question, but what's the workflow for debugging TSOA at runtime (Breakpoints & step through). Is primarily through tests, or can I ad-hoc attach a debugger to it while building our own API definitions? I've been reading through the linked code, and stepping a debugger through it will probably be a lot more helpful 🤔 |
I'll usually debug from the test suite, but you should be able to debug your app. But make sure node_modules are not ignored in the debugger config. If you're using vscode, you can get it to generate a debug config that you'll wanna point to node_modules/.bin/tsoa and call it with routes or spec as an arg. |
Hi, Has someone found a solution for this issue? This is this type I need to use as a response:
This is the error:
I'm sorry I can't dive into the tsoa library and try to make a fix, this is way above my knowledge |
I think the "Unknown type: IndexedAccessType" error can occur in several cases that are not handled in the function TypeResolver.resolveIndexedAccessType |
Sorting
I'm submitting a ...
I confirm that I
I found several referneced, but they all appeard to be fixed...?
Expected Behavior
When I tun
tsoa routes
the following controller fails:Current Behavior
This fails with:
Possible Solution
Unknown
Steps to Reproduce
Use the above code with
tsoa
Context (Environment)
Version of the library:
6.2.1
Version of NodeJS:
18.13.0
pnpm
Detailed Description
N/A See above
Breaking change?
The text was updated successfully, but these errors were encountered: