This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jeremy Friedland
Posted Nov 15 - Read on Facebook

Is anyone else running into issues with Yosemite and version 1.9.9 of Framer Studio. I am getting a script error (see screenshot below). Any help in getting my prototypes back in working order would be greatly appreciated!

17 Comments

Koen Bok

Can you try to create a new document, copy your code over and the "imported" folder from the project?

Jeremy Friedland

Koen, this did not fix it. Still getting the script error and no assets loaded in framer studio. When I open the index file in Safari the prototype loads.

Jeremy Friedland

Koen, unfortunately I cannot share the project. Any other ideas?

Koen Bok

I can explain what is happening.

The information about the imported photohop/sketch file is in json. You can find them in imported/<project>/layers.json

WebKit2 has a new security feature (like Chrome always had) where I can't load json files with javascript anymore (cross origin request).

To work around it, I generate a Javascript file before load that has all the info included. You can find that in framer/generated.js.

The error you are seeing is Framer still trying to load the json file anyway. That could mean that 1) the generated.js file isn't being loaded in de index.html or 2) that the generated.js file doesn't contain the right info.

Could it maybe be that you renamed the folder in imported?

Jeremy Friedland

Will there be a fix? Unfortunately I'm very novice at this, so I am a bit confused by the possible workaround.

Koen Bok

I will definitely fix it as soon as can exactly pinpoint it. I think some others ran into this too, so I'll see if I can inspect their projects.

Emanuele Salamone

I tried starting a new project, importing the same PSD and then copy/pasted the app.coffee code and the json files i wanted to load. Still doesn't work, so the new generated files can't fix this.
I made a quick test case, which you can find here: https://dl.dropboxusercontent.com/u/33829445/Framer/jsonErrorTestCase.framer.zip

Koen Bok

Hey Emanuele, this one is easy. You use the domLoadJSONSync function which is now forbidden in WebKit2 for security.

Emanuele Salamone

Koen Bok, i saw that was the problem, but how can i use an external JSON?
My code depends on very large data structures on enternal JSONs...

Koen Bok

Turn your json into Javascript and add it to the index.html:

window.myJsonThing = {...}

Emanuele Salamone

Thanks, i will do this! The only downside is the scope pollution, but whatever!
Thanks for your help

Koen Bok

Yep, that is true. I use something like window._imports["<file>"] for all my imports.

Jeremy Friedland

Koen, anyway you can put that into layman terms?

Jeremy Friedland

I rolled back to framer v 1.8 and everything is working now.

BJ Clark

Fwiw, the Facebook example project throws this error for me, if that helps tracking it down.

Eng Phannipha

Talked to Jeremy about this. The issue is most likely due to Sketch file getting corrupted somehow when it's on Dropbox. The fix is to create a new Sketch file locally, copy all your layers (from your old corrupted file), and paste them into your new Sketch file.

Read the entire post on Facebook