-
Notifications
You must be signed in to change notification settings - Fork 33
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
v1.12.0: Failed to execute 'fetch' on 'Window': Illegal invocation #1098
Comments
Hi @seniorquico |
@baywet I upgraded to the following dependency versions and reverted the initialization code, but I still get the the "illegal invocation" error. The workaround still works with these new versions, as well.
Very odd! |
@baywet And just to confirm- reverting to Kiota v1.12.0-preview.202402220002, the following dependency versions, and the original initialization code (no explicit
This was what we had been testing with prior to upgrading to Kiota v1.12.0. |
Thanks for the additional information. when looking at the changes between both versions the only things that jump to mind are default values for the middlewareFactory and httpClient, I suspect that somehow an undefined is being kept instead if using parameters default values. Maybe the httpClient constructor should get defaulted with Regardless, I think a regression was introduced, if a custom is in fact passed to the constructor parameter, we'll end up with two CustomFetchHandlers and I think the body of the constructor should be mostly reverted to what it was besides the renames. And as for the default values, maybe Do you think you could explore those avenues by cloning the repository locally and testing those changes? |
@baywet No, this is happening in both development & production builds of the app in the web browser. I actually haven't tested it yet with vitest. Happy to try a local, modified build. This may take a few days, but I'll get back as soon as I can. |
I'm experiencing this error as well using the latest version 1.12.0 and latest preview of the different npm's |
Thanks everyone for the additional input. It helps a lot. |
Adding this to the requestAdaptor |
I just tested with Kiota 1.13.0-preview.202403280001 and manually updated to the following:
I can confirm it's fixed and working without the explicit bind. Thanks, all! |
We upgraded our web-based, Vite/React SPA to the new Kiota v1.12.0 and upgraded our generated API client. The dependencies in our project were updated to include (as dictated by
kiota info ...
):Running the updated project, API requests fail with the following message and stack:
Our client initialization code has been:
Modifying the client initialization to use an explicitly bound
window.fetch
function "fixes" the error and gets us back to a working integration:Are we initializing our API client correctly? Or is this an unintentional issue with Kiota v1.12.0?
(Edit: And I should note- downgrading to the previous version of Kiota also works.)
The text was updated successfully, but these errors were encountered: