JSON-to-Figma
JSON-to-Figma copied to clipboard
Fetch json from Clipboard link doesn't work
Trying with https://jsonplaceholder.typicode.com/todos/1 returns "It is not a link"
isLocalhost.tsx:13 It is not a link App.tsx:30 SyntaxError: Unexpected token T in JSON at position 0 showErrorMsg @ App.tsx:30 (anonymous) @ App.tsx:59 (anonymous) @ fetchJSONfromURL.tsx:23 Promise.catch (async) (anonymous) @ fetchJSONfromURL.tsx:22 (anonymous) @ fetchJSONfromURL.tsx:7 ./src/app/utils/fetchJSONfromURL.tsx.__awaiter @ fetchJSONfromURL.tsx:3 fetchJSONfromURL @ fetchJSONfromURL.tsx:15 fetchUrlLink @ App.tsx:54 callCallback @ react-dom.development.js:188 invokeGuardedCallbackDev @ react-dom.development.js:237 invokeGuardedCallback @ react-dom.development.js:292 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:306 executeDispatch @ react-dom.development.js:389 executeDispatchesInOrder @ react-dom.development.js:414 executeDispatchesAndRelease @ react-dom.development.js:3278 executeDispatchesAndReleaseTopLevel @ react-dom.development.js:3287 forEachAccumulated @ react-dom.development.js:3259 runEventsInBatch @ react-dom.development.js:3304 runExtractedPluginEventsInBatch @ react-dom.development.js:3514 handleTopLevel @ react-dom.development.js:3558 batchedEventUpdates$1 @ react-dom.development.js:21871 batchedEventUpdates @ react-dom.development.js:795 dispatchEventForLegacyPluginEventSystem @ react-dom.development.js:3568 attemptToDispatchEvent @ react-dom.development.js:4267 dispatchEvent @ react-dom.development.js:4189 unstable_runWithPriority @ scheduler.development.js:653 runWithPriority$1 @ react-dom.development.js:11039 discreteUpdates$1 @ react-dom.development.js:21887 discreteUpdates @ react-dom.development.js:806 dispatchDiscreteEvent @ react-dom.development.js:4168
Hey @lambaek, have you tried using https://jsonplaceholder.typicode.com/todos/ instead? I belive the data file needs to contain an array rather than an object
Hi @shakeelmohamed , i have also tried with an array and it fails already when trying to fetch the json from the url. Our current workaround is to save our json array into a test.json file, and then import it manually.
When i click the "From clipboard link" button, it gives console error "It is not a link"
Trying with https://jsonplaceholder.typicode.com/todos/1 returns "It is not a link"
isLocalhost.tsx:13 It is not a link App.tsx:30 SyntaxError: Unexpected token T in JSON at position 0 showErrorMsg @ App.tsx:30 (anonymous) @ App.tsx:59 (anonymous) @ fetchJSONfromURL.tsx:23 Promise.catch (async) (anonymous) @ fetchJSONfromURL.tsx:22 (anonymous) @ fetchJSONfromURL.tsx:7 ./src/app/utils/fetchJSONfromURL.tsx.__awaiter @ fetchJSONfromURL.tsx:3 fetchJSONfromURL @ fetchJSONfromURL.tsx:15 fetchUrlLink @ App.tsx:54 callCallback @ react-dom.development.js:188 invokeGuardedCallbackDev @ react-dom.development.js:237 invokeGuardedCallback @ react-dom.development.js:292 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:306 executeDispatch @ react-dom.development.js:389 executeDispatchesInOrder @ react-dom.development.js:414 executeDispatchesAndRelease @ react-dom.development.js:3278 executeDispatchesAndReleaseTopLevel @ react-dom.development.js:3287 forEachAccumulated @ react-dom.development.js:3259 runEventsInBatch @ react-dom.development.js:3304 runExtractedPluginEventsInBatch @ react-dom.development.js:3514 handleTopLevel @ react-dom.development.js:3558 batchedEventUpdates$1 @ react-dom.development.js:21871 batchedEventUpdates @ react-dom.development.js:795 dispatchEventForLegacyPluginEventSystem @ react-dom.development.js:3568 attemptToDispatchEvent @ react-dom.development.js:4267 dispatchEvent @ react-dom.development.js:4189 unstable_runWithPriority @ scheduler.development.js:653 runWithPriority$1 @ react-dom.development.js:11039 discreteUpdates$1 @ react-dom.development.js:21887 discreteUpdates @ react-dom.development.js:806 dispatchDiscreteEvent @ react-dom.development.js:4168
Here is the problem with the JSON. It should be wrapped in an array like this [{},{},{}]
Same error with the https://jsonplaceholder.typicode.com/todos/ url
Hi @shakeelmohamed , i have also tried with an array and it fails already when trying to fetch the json from the url. Our current workaround is to save our json array into a test.json file, and then import it manually.
When i click the "From clipboard link" button, it gives console error "It is not a link"
Hmm... I tried to fetch https://jsonplaceholder.typicode.com/todos and it works

Hmm.. Not sure what i'm doing wrong then...
https://gyazo.com/bdd08c579baba46b5bd283cbaf6cf7e3
@lambaek seems like it doesn't work in the web version of Figma. Will check it. Did you use app or web version?

Web version
Web version
Try the app. I'll check how I can fix the issue on the web version
Web version
Try the app. I'll check how I can fix the issue on the web version
Can confirm the app is working. Looking forward to see if you can fix the web version, as this is the one we mainly use. But a quick fix for now is to have the team download the app.