commercetools-sdk-typescript icon indicating copy to clipboard operation
commercetools-sdk-typescript copied to clipboard

@commercetools/ts-client is raising a DeprecationWarning for .data attribute

Open mvantellingen opened this issue 2 years ago • 0 comments

It seems the @commercetools/ts-client is using data as input arg instead of body. This results in the following deprecation warning

[https://github.com/node-fetch/node-fetch/issues/1000 (request)] DeprecationWarning: .data is not a valid RequestInit property, use .body instead
    at new Request (file:///my-project/node_modules/.pnpm/[email protected]/node_modules/node-fetch/src/request.js:69:4)
    at file:///my-project/node_modules/.pnpm/[email protected]/node_modules/node-fetch/src/index.js:51:19
    at new Promise (<anonymous>)
    at fetch (file:///my-project/node_modules/.pnpm/[email protected]/node_modules/node-fetch/src/index.js:49:9)
    at execute (/my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:172:14)
    at executeWithRetry (/my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:190:29)
    at /my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:211:28
    at sendRequest (/my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:133:28)
    at executeHttpClientRequest (/my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:145:10)
    at executor (/my-project/node_modules/.pnpm/@[email protected]/node_modules/@commercetools/ts-client/dist/commercetools-ts-client.cjs.dev.js:153:22)

The stacktrace is added via the node option --trace-deprecation

Might be due to https://github.com/commercetools/commercetools-sdk-typescript/blob/1bb77fcea8e5601dffd16438193de17d38cbfbef/packages/sdk-client-v3/src/utils/executor.ts#L113

mvantellingen avatar Aug 14 '23 12:08 mvantellingen