-
Notifications
You must be signed in to change notification settings - Fork 407
Maximum call stack size exceeded #35
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
Comments
An initial guess: https://github.com/bcherny/json-schema-to-typescript/blob/master/src/index.ts#L313 because
Is the full stack trace shown above? I didn't attempt to reproduce... but made this guess by looking for recursive lodash methods used by this project. My guess is https://github.com/bcherny/json-schema-to-typescript/blob/master/src/index.ts#L313 is in the stack trace. I don't have time to look at this further today... and may not in next few days. But wanted to share my initial findings. I think https://github.com/bcherny/json-schema-to-typescript/blob/master/src/index.ts#L313 can be refactored to not use lodash and this may solve the problem. |
Yes. |
FYI: I have a test in place that blows the stack. darcyparker@db2b30c |
Updating link for line with json-schema-to-typescript/src/index.ts Line 274 in 1aa7317
|
A WIP that improves call stack usage is available for review. Please let me know if it helps. |
@donaldpipowitch You're getting a call stack exceeded error because you have a bunch of circular references in your schema
I'll add a circular reference checker to the ref resolver (the resolver is very bare bones as is). In the meantime, if you get rid of the circular references, your schema seems to compile fine. |
Thank you both. I'll close this issue than as it is probably a problem with the schema and its circular references. |
Short question: Is this really a circular reference? Doesn't this point to this definition? |
Side question: Do you know of a tool that generates a graph of a json schema? (For example something that creates graphml for http://www.yworks.com/products/yed or http://www.cytoscape.org/, or alternatively dot files for http://graphviz.org/ dot) If not, I am thinking this could be an interesting project. It's one thing to write circular reference detection and give feedback when you walk to a node that you've been to before... but visually seeing it in a picture could be helpful. |
@donaldpipowitch You're right - I misread the schema. This issue is with resolving local $refs, not with a circular definition. Filed #44 @darcyparker Not off the top of my head, but it would be pretty trivial to write one I think. |
Uh oh!
There was an error while loading. Please reload this page.
Try to
compileFromFile
this schema throws.The webpack schema is quite heavy. Perfect stress test to optimize ;) Note that you have to delete this enum because of #34 to get this working for now.
The text was updated successfully, but these errors were encountered: