-
Notifications
You must be signed in to change notification settings - Fork 214
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
Bug TypeScript: Runtime error when executing generated code for Graph API #870
Comments
Hey @nikithauc
|
Sample code :
Platform: node Generation command: |
thanks for the additional information, just checking you're using the latest version of kiota (building it) rather than downloading the binaries? |
I pulled the latest changes and rebuilt the project. Executed generation command under You can find the generated request builders here.. To check the error, you can also clone the repo, switch to the
|
When running the ESM compilation, the error that I get is
The errors are liked to circular dependency. |
cc: @sebastienlevert |
I also saw something similar on my first attempt to generate the entire tree of request builders. Does it happen with only specific entities? |
I don't think so. |
Used madge to track the circular dependencies. The error in this issue is caused when a parent class has circular dependency and module loader fails to locate the extended parent class while initiating the child class. ✖ Found 42 circular dependencies!
|
What would be the right approach then here? Would it be to create a barrel index.ts file with the right classes in the right order (example, |
Also adding @RabebOthmani for visibility. |
|
Thanks for the patience on this, I haven't had time to look into this in details yet.
Thoughts? |
Do we have a spec on backing store to go through to understand in detail about the need of classes in detail? |
+1 on the ask from @nikithauc here. Also, what are the default values we are talking about? This is a great move forward, but I'm afraid this doesn't solve the underlying issues... Adding @darrelmiller to this thread for a deeper understanding of the requirement for the backing store and help with resolving this issue. |
We do have some documentation here but I'm afraid there's no written spec for the time being. |
@baywet, can we split this in 2 parts?
This would unlock us to be able to ship a version of the SDK that works on the entire surface. Thanks! |
before we commit to that, I'd like to have time for a few things:
|
I think some of that work should be done with @nikithauc but I agree with your approach! |
I didn't express myself clearly, apologies. My thoughts were also along the lines of Nikitha exploring the avenues listed in bullet point 1 |
Some work happened, yes. But the current state of things is still making things hard. I don't think we achieved anything regarding the circular references, which creates a big road block for us to even explore other ideas. It's not a module or TypeScript thing... It's a JavaScript runtime issue... |
The circular issue exists with ES modules too. I had tested CJS and ES at the time I faced this issue. Sorry I should have mentioned this earlier. What I am currently working on is generating index.ts (which is also related to #938 ). The exports in the index file should be ordered based on the order of inheritance. I was able to get through this error with some manual modifications :) but now I am facing a new error :( . Investigating this ! |
that good news! thanks for looking into this. Would you mind sharing the details of that new error please? |
Steps to reproduce:
Expected: Result from Graph API.
Actual:
The text was updated successfully, but these errors were encountered: