-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
RangeError: Maximum call stack size exceeded #922
Comments
Have you tried to run the |
No, I tried to run it through ts-node. I'll try it via tsc and post the results. |
@samchon Here is my router that does not work as originally intended. You were right, I really removed all the errors and tried to build the project. The assembly was successful. But swagger:build showed that I was using incorrect types for validation, namely nested objects and the union type:
npm run swagger:build:
In this regard, I would like to ask 2 questions. These 2 restrictions make it impossible to validate most queries because most often there are nested objects and unions.
I'd really like to fix this because I was so impressed with your library that I implemented it into my work project. 🙏🙏🙏 UDP I tried replacing TypedQuery with TypedBody cause it doesn't have these restrictions., but as expected I got the same error:
As I said earlier, validation breaks down when analyzing looped links(
Is there some way to fix this in your library? |
|
Fix #922: change no transform configuration error message.
@samchon Yes, that's what I understood, but you probably misunderstood the last part of my message. I tried using TypedBody and encountered a stack overflow due to a looped reference. That is, my problem is not solved. Is there a plan to fix this in the future or could you tell me where I could look and fix it in your code myself? I just need to write a crutch that would limit looped repetitions to, for example, 3 times. |
Can you give me a reproducible repo with the |
@samchon Yes give me a couple of minutes |
@samchon I tried to reproduce this task using route 1 as an example. But something strange happens (it works). When I write the same thing in a working project, this error appears with recursion. I'll try to fix my working repository exactly like in this repository (https://github.com/Mario2280/Nestia_test_recursion) and post the results to see if the problem is fixed |
If you case is belonged to this issue (samchon/typia#1108), it may be fixed by updating the |
@samchon Will this fix work for types and for interfaces? Because I can’t change it if prisma generate will create a bunch of types (and interfaces will be needed) UDP I did everything 1 in 1 in my working project, there in the test project the link to which I sent above. This is the error I get:
Here is a short sequence of how these tables are connected. I tried to recreate the same thing in a test project, but I couldn’t find the source of the error (I had an assumption that it had something to do with the many-to-many relationship in the database):
I tried for several hours to figure out what the error was, but I couldn’t find it. |
The nonsensible intersection message comes by In such reason, I'm not using Prisma generated types as DTO directly. In the actual service, DTO cannot be 1:1 correspondent with ORM schemes, because the DTO has been composed by combinating DB entities complicately. |
@samchon Can I put a stub specifically for this type to avoid errors and complete the generation of js code for validation without errors? This is very important to me because when I saw your library, the first thing I thought was to do something similar using Prisma types and try to implement it into a working project to validate complex queries with select where include commands(like this libs but it works with https://github.com/unlight/prisma-nestjs-graphql). I most likely understand that pure types are built into the core of your library and this rule is difficult to change, but imagine if it were possible to handle such problematic situations, this would give your library a very powerful feature. Do you have any ideas on how to get around this problem? Or there is no way out and I will have to register all these interfaces manually and eliminate this error (this is a lot of work, I would not like to do this... |
Feature Request
Fix all funtions like validate equals and creating types
for highly nested objects.
Or if I didn't read the documentation well, how can I solve this problem using your wonderful library
Hi I wanted to create a custom PaginationBody type. I created this interface
And i use it like this
The problem is that prisma generates a looping dependency Prisma.PaymentWhereInput:
This code throw error
I used one package when I wrote an application using graphql and the type generation library (https://github.com/unlight/prisma-nestjs-graphql). Validation was generated there and there was no problem with large nesting.
PS
I also noticed that if an object is highly nested and there is not necessarily a cyclic dependency, it generates an error (Error: Error on typia.equals(): no transform has been configured. Read and follow https://typia.io/docs/setup please). I followed all the installation steps, but the problem was not solved. This is most likely a separate issue, but perhaps they are related.
The text was updated successfully, but these errors were encountered: