Skip to content

FetchRequestAdapter causes error to be thrown on initialization #6597

@judah-caruso

Description

@judah-caruso

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

TypeScript

Describe the bug

When using the FetchRequestAdapter from @microsoft/kiota-http-fetchlibrary, an error is thrown at initialization time when the client is created. This occurs when using version ^1.0.0-preview.93.

Expected behavior

Client initialization succeeds.

How to reproduce

  • Generate a TypeScript client (directly follow examples here)
  • Create a new package that imports the generated client:
// index.ts
import { AnonymousAuthenticationProvider } from "@microsoft/kiota-abstractions";
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import { createApiClient } from "generated-api-client"; 

const authProvider = new AnonymousAuthenticationProvider();
const adapter = new FetchRequestAdapter(authProvider);
const client = createApiClient(adapter); // error occurs during this call 

I've ensured all Kiota package versions match between the generated client and the package importing the client, as well as their tsconfig.json files.

Open API description file

No response

Kiota Version

1.26.1+a5df7c03bab621bb2d4dc728516fc9c488cabadb

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

  • OS: MacOS Sequoia 15.5
  • Architecture: Arm64

Debug output

Registered middlewares: RetryHandler, RedirectHandler, ParametersNameDecodingHandler, UserAgentHandler, HeadersInspectionHandler, UrlReplaceHandler, CustomFetchHandler
Hint: to improve performance, use MiddlewareFactory.getPerformanceMiddlewares(customFetch) instead of MiddlewareFactory.getDefaultMiddlewares(customFetch)

file:[path/to/client.js]
  throw new Error("requestAdapter.getParseNodeFactory() is not a ParseNodeFactoryRegistry");

Other information

No response

Metadata

Metadata

Assignees

Labels

TypeScriptPull requests that update Javascript codepriority:p1High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7daystype:bugA broken experience

Type

Projects

Status

Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions