Skip to main content
Question

Fetch from plugin API

  • February 12, 2023
  • 0 replies
  • 515 views

I’m experimenting with fetch

const opt: FetchOptions = {
  method: "GET"
};
fetch('https://google.com/api/v1/users/profiles/?format=api', opt)
.then(res => res.text())         
.then(text => console.log("+++"))  
.catch(c=> console.log("--"));

nothing is requested. console shows this error:

figma_app.min.js.br:formatted:1366 Error: Syntax error on line 1: Unexpected token .
    at vXt (figma_app.min.js.br:formatted:260853:13)
    at async figma_app.min.js.br:formatted:261468:50

This snippet causes the error. because if I comment it the rest works as expected.

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings