Closed
Description
Looks like the apiClientProxifier blows up when an instance is returned from an async function. I am loading some server-side configuration options before generating the client and wanted to return the client instance in a single pass.
export async function getApiClient() : Promise<ApiClient> {
const ibOptions = await fetch('/api/auth/client-config').then(r => r.json());
const credential = new InteractiveBrowserCredential(ibOptions);
const authProvider = new AzureIdentityAuthenticationProvider(credential, ['api://<api-client-id>/scopename']);
const adapter = new FetchRequestAdapter(authProvider);
adapter.baseUrl = location.origin;
var client = createApiClient(adapter);
return client;
}
When I call this method, I receive the error message couldn't find navigation property then data
.
It looks like what is needed, is inside apiClientProxifier
is a special name check for then
that simply returns undefined
in order to satisfy the Promise resolution logic.
Metadata
Metadata
Assignees
Type
Projects
Status
Done ✔️