Api error show TypeError: i is not a function

Thank you in advance

72c72d32-09ab-45bf-9…f89deb5c56f468137:1 Error sending SMS: TypeError: i is not a function

at t.N (72c72d32-09ab-45bf-9…b5c56f468137:1:4633)

at t (index.js:403:30)

at Object.call (index.js:102:30)

at MessagePort.d (index.js:408:42)

N @ 72c72d32-09ab-45bf-9…f89deb5c56f468137:1

t @ index.js:403

call @ index.js:102

d @ index.js:408

i am facing ablove in

@hubspot/ui-extensions this extension when i call a api and my fuction is

const response = await fetchApi(‘http://localhost:8000/send-message’, {

    method: 'POST', // Method is a direct option for fetchApi

    headers: {

      'Content-Type': 'application/json',

    },

    body: JSON.stringify({

      number: phoneNumber,

      portalId: portalId,

      message: input,

    }),

  });

Hi @sagar_tomar1, I hope that you are well!
Thank you for asking the HubSpot Community!
So that we help you the best we can, what are you trying to achieve please?
And with which endpoint? Do you have a documentation to share?
The more info, screenshots (without sensitive/confidential information), and details you can provide, the better the Community can assist.

I’d love to put you in touch with our Top Experts: Hi @Anton, @sylvain_tirreau and @zach_threadint do you have suggestions to help @sagar_tomar1, please?
Have a wonderful day and thanks so much in advance for your help!
Bérangère

Hi @sagar_tomar1

Please share the top part of your file (imports and how fetchApi is defined), I believe there must be an error in importing the file.

Here are some tips -

Use fetchApi only inside UI extensions and import it correctly.

Use regular fetch() in non-extension code."

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.

Thanks!