Skip to content
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

node-fetch problem #423

Open
skekec1 opened this issue Aug 13, 2024 · 0 comments
Open

node-fetch problem #423

skekec1 opened this issue Aug 13, 2024 · 0 comments
Labels

Comments

@skekec1
Copy link

skekec1 commented Aug 13, 2024

Describe the Bug
Creating the client and executing "tickets.show()" leads to:

/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/node-fetch/lib/index.js:344
                return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
                             ^
TypeError: body used already for: https://d3v-idoit.zendesk.com/api/v2/tickets/26.json
    at Response.consumeBody (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/node-fetch/lib/index.js:344:30)
    at Response.json (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/node-fetch/lib/index.js:269:22)
    at Object.json (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/node-zendesk/dist/index.js:1:11255)
    at TransformOperationExecutor.transform (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/src/TransformOperationExecutor.ts:207:39)
    at TransformOperationExecutor.transform (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/src/TransformOperationExecutor.ts:327:31)
    at ClassTransformer.instanceToPlain (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/src/ClassTransformer.ts:25:21)
    at Object.classToPlain (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/src/index.ts:23:27)
    at ClassSerializerInterceptor.transformToPlain (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js:50:37)
    at ClassSerializerInterceptor.serialize (/home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js:43:20)
    at /home/selcuk/dev/idoit/projects/i-doit-sfm/backend/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js:32:54

Example Code

const connection = createClient({
 username: configService.get('ZENDESK_USERNAME'),
 token: configService.get('ZENDESK_TOKEN'),
 subdomain: configService.get('ZENDESK_SUBDOMAIN')
});

const result = connection.tickets.show(25);

I am using:
node-zendesk: ^5.0.13
node: v18.20.2

@skekec1 skekec1 added the bug label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant