Save Image - Javascript Error


#1

Created a simple test with 1 x background image element, and 2 x 'button' elements each with 3 states. All very simple. When right-clicking on the first button element, and using the Save Image option, a Javascript error is generated as shown attached.

Thanks
Chris


Exporting/Previewing
#2

Here is my Javascript install info (this is the latest version at time of posting)


2016.11.21 Subform release 6bdeabc
#3

Hi @chris.williams,

Thanks for the excellent report and screenshot.
It looks like the error may be that Subform is not being allowed to open up a temporary file on Windows.

I'll look into this and update this topic.

Just FYI: Java and JavaScript are related for marketing reasons from the 1990s and don't actually have much to do with each other technically.


#4

Thanks Kevin, hadn't realised about Java / Javascript differences - thanks for the tip :slight_smile:


#5

It seems that the underlying issue was a permissions error when renaming temporary files on Windows.
I changed the internals so that we don't need to do a rename, and tested that it fixed the issue on my Windows 8 machine.

Please let me know on this topic if the next release doesn't resolve the issue for you, @chris.williams
Thanks again for the report!


#6

I just saw something very similar when trying to export a PNG on OSX. I think in this case it was because the export window defaulted to the root of my HDD and my user doesn't have write permissions there. Picking a folder in my userspace fixed it but a more user-friendly error message would be good here.

Uncaught Exception:
Error: EACCES: permission denied, open '/awesome.png.__new__'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:178:20)
    at Object.fs.writeFileSync (fs.js:1343:33)
    at writeFileSync (/Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/node_modules/fs-jetpack/lib/write.js:32:8)
    at writeAtomicSync (/Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/node_modules/fs-jetpack/lib/write.js:48:3)
    at Object.writeSync [as sync] (/Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/node_modules/fs-jetpack/lib/write.js:61:3)
    at Object.write (/Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/node_modules/fs-jetpack/lib/jetpack.js:211:13)
    at /Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/main.js:97:10
    at Function.<anonymous> (/Users/eliot/Applications/Subform.app/Contents/Resources/app.asar/render_html.js:52:13)

#7

Thanks @eliotlash, I'll add this to my list and see if we can come up with a nice solution for this issue, which really affects every operation that involves saving out to a user-specified location. The solution should also handle other situations like being out of disk space.


#8

Thanks @kevin, look forward to the update.