Skip to content

(intermediate value) is not iterable #1408

Open
@NakileSolutions

Description

@NakileSolutions

Hello,

I'm trying to instantiate multiple client instances manually as written in your README.me but when I try to use the request function I have this error:
TypeError: (intermediate value) is not iterable

You can have a look at my code here :

import { Client } from "@sendgrid/client";
import sgMail from "@sendgrid/mail";
import { config } from "../../config";

const sgClient = new Client();
const sgClient2 = new Client();

sgClient.setApiKey(config.apiKey);
sgClient2.setApiKey(config.apiKey2);

export { sgClient, sgClient2, sgMail };
const sendgrid = priority ? sgClient2 : sgClient;
    // eslint-disable-next-line no-await-in-loop
    const [res, body]: [ClientResponse, TemplateResponseBody] = await sendgrid.request({
      method: "GET",
      url,
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions