FoldingText no longer works with macOS 10.12.4

The error message when launching /Applications/FoldingText.app/Contents/MacOS/FoldingText from the terminal is:

2017-03-29 09:41:25.215 FoldingText[5555:95954] *** WARNING: Method convertPointToBase: in class NSView is deprecated on 10.7 and later. It should not be used in new applications. 
2017-03-29 09:41:28.275 FoldingText[5555:95954] Failed to load Javascript on start

Tried on the latest FoldingText-Dev.dmg I have. Unfortunately I can’t check the version because FoldingText won’t start.

I just updated to macOS 10.12.4 and both the FoldingText release and preview versions appear to be working for me.

FoldingText Version 2.2 (770)

FoldingText 2.3 Dev (781)

Can you try downloading one of those two versions and see if it works? If you still see error can you try running one of those version from your guest user account and see if that makes a difference?

Same for me, Jesse. (launching from Finder and Spotlight).
However, I think mine was failing to open BEFORE I updated to 10.12.4.
(I have since updated to 10.12.4)

FT beta quits immediately after launch.

What I tried:

  1. Re-downloaded the latest FoldingText-Dev.dmg (linked in your response).
    Same result.
  2. Downloaded release version from Mac app store, and that version does work.
    Tried beta after running release version, still no bueno.
  3. DOES work in guest user account.

FYI

Works fine for me (Version 2.2), 10.12.4

So I’m getting errors about Receipts
2017-03-30 09:52:30.269 FoldingText[2028:80868] Failed to copy reciept with error: Error Domain=NSCocoaErrorDomain Code=260 “The file “A8/60/B6/13/B5/10” couldn’t be opened because there is no such file.”
And also the Javascript error which could be an installed plugin it doesn’t say
2017-03-30 09:53:07.276 FoldingText[2028:80868] Failed to load Javascript on start

Then I launched it and it launched from the Finder, and opened one document and then ‘crashed’ when I loaded another document (just stopped actually, there was no backtrace or anything like that). Now it seems to launch sometimes, sometimes not and reliably bails when I try to open one of my project documents. So in summary see the title of this thread.

I forgot FoldingText 2.2 non appstore (paddle) not the dev version

I narrowed it down I noticed it seemed to open some documents and not others. The distinguishing characteristic was the inclusion of markdown URLs of the form [some text](url) Removing all urls and I can access my project document.

Hi Jesse, not sure what happened there.

I deleted ~/Library/Application Support/FoldingText and launched FoldingText as usual, it asked me to re-register, which I did, and it’s now working fine, so from my point of view this is resolved as filed as ‘freak accident’ :slight_smile:

I’m pretty sure the only thing that changed in my system was the OS upgrade. I’m pretty sure I didn’t touch anything else, but it’s working now and I’m happy :slight_smile:

I had the same problem - FT v2.2 worked great with jmk_panel.ftplugin. After updating to 10.12.4, FT failed to launch - the menu would appear for a second then disappear. I believe I found a similar message in the Console regarding failure to load javascript on start. I uninstalled, re-installed to no avail. I installed FT Dev v2.3 and it worked, but when I re-installed the ftplugin, same problem. I’m currently running FT v2.3 without any plugins :frowning:

Same here, can no longer start folding text directly after update to 10.12.4 . Tried the 2 releases Jesse points to. Works 1 time (when clicking on the foldingtext.app icon directly after installing). When I quit and try to restart (via spotlight search or finder) I shortly see the foldingtext menu bar, but no document. It closes within seconds. I see this in my system logs: FoldingText[1389]: Failed to load Javascript on start

Since folding text is my nr 1 app on the mac, this is pretty ‘annoying’.

I don’t see the ~/Library/Application Support/FoldingText folder in my finder (nor in my terminal). And didn’t see any plugins listed in my preferences when folding text opened 1 time directly after install.

Would love to have some suggestions on getting it up and running again.

Update:

Workaround by starting up via the .dmg. No javascript errors in my system log when starting up like that. Seem to have lost my plugins; empty plugins folder in my application folder. Startup via spotlight still not working.

Further thoughts I removed Jamie Kowalski’s jmk_panel and for now application is starting up. I mentioned wiki links, I don’t have the foldingtext-extra for that and slightly embarrassed I think that was a red-herring. I wish I would be able fix it, but sadly no real javascript skills. https://github.com/jamiekowalski/foldingtext-extra maybe needs some tweaks, I certainly wish the jmk_panel could be incorporated into the application.

Still hoping for some response on this support request. My workflow is badly broken.

How can I help getting to the core of this issue? What tests could I do, what error logs should I check, what information do you need to fix this?

Sorry for the late response on this, but I looked at some of the earlier messages and the issue seemed to be related to a specific plugin installed, namely the ‘jmk_plugin’. I have investigated this, but unfortunately haven’t been able to reproduce the issue on my end. (more details on my post here).

Since you mention also in your earlier post that you are able to run foldingtext via the dmg, perhaps that also seems to point to the same issue.

There are a few things I’m not sure I understand, and hopefully you can clarify:

  • You mention that you were able to open FoldingText once, but that plugins were missing. Did you have the jmk_plugin installed previously? Also, what did you do anything specific the first time?
  • I’m not sure why you’re unable to find the FoldingText Application Support folder on your mac. Perhaps try looking for it in /Library/Application Support/Foldingtext.
  • Also, try running the following command in the terminal find / -name FoldingText 2>/dev/null to see if that can locate the Application Support folder for you.

Regards,
Mutahhir

Hi Mutahhir,

Thanks for the response. I’ll try to provide the information:

  • I have started Foldingtext by starting the FoldingText-2.3 Dev dmg and then double clicking the FoldingText.app icon which is displayed in the installation process. The ‘Info’ window tells me this FoldingText.app starts from ~/Downloads/FoldingText-Dev-2.dmg
  • When opening the application folder via the folding text file menu, I see an empty plugin directory (~/Library/Application Support/FoldingText/Plug-Ins)
  • I do remember installing plugins. I don’t know which ones, but I do know for instance that I use the cmd-shift-9 shortcut quite often. In my normal installation, it would popup a textfield where I could type dates in a human friendly way like now, tomorrow, etc. That shortcut doesn’t work at the moment.
  • Running your command results in this list:
    • /Applications/FoldingText.app/Contents/MacOS/FoldingText
    • /private/var/folders/y1/lxfkbpt54qx2w0m6zcrgxg6w0000gn/T/AppTranslocation/459F8BCD-57E3-4C39-9EE6-C4D89844C50A/d/FoldingText.app/Contents/MacOS/FoldingText
    • ~/.Trash/FoldingText
    • ~/.Trash/FoldingText 2.app/Contents/MacOS/FoldingText
    • ~/FoldingText
    • ~/Library/Application Support/FoldingText
    • ~/Library/Containers/com.foldingtext.FoldingText/Data/Library/Application Support/FoldingText
    • ~/Library/Scripts/Applications/FoldingText
    • /Volumes/FoldingText-2.2/FoldingText.app/Contents/MacOS/FoldingText
    • /Volumes/FoldingText-2.3 Dev/FoldingText.app/Contents/MacOS/FoldingText
  • In ~/FoldingText I see a plugin directory which is probably where I back up my plugins. This is the list of plugins (no guarantee these are also exactly the plugins running in my normal foldingtext install):
    • capitalize list items.ftplugin
    • date and time.ftplugin
    • filtering word count.ftplugin
    • keybindings.ftplugin
    • reverse text.ftplugin
    • run script.ftplugin
    • sort lines.ftplugin
    • speed up.ftplugin
    • stopwatch.ftplugin
    • toggle empty lines.ftplugin
    • toggle tags.ftplugin
    • wiki links.ftplugin
  • When opening my installed foldingtext via the commandline (open -F ./FoldingText.app/) or via spotlight or by double clicking a .ft document I consistently get the behaviour described before: I shortly see the foldingtext menu bar, but no document. The menubar closes within seconds.
  • Since I use FoldingText continuously during the day, I’m absolutely sure this behaviour started directly after the update to macOS 10.12.4 (no problems before - , directly problems after update). I didn’t do anything special the first time, just the usual opening of foldingtext via spotlight.

Hope this helps, if you need more information, let me know!

Regards,
Maarten

Hi Maarten,

Thanks for the update. Sorry for not realizing this earlier, but somehow I believed that I was running 10.12.4, but I was in fact running 10.12.3.

I did some debugging, and, while there is no problem with FoldingText loading on 10.12.4, there is indeed a problem with 10.12.4 and the jmk_plugin.

I’ve also been able to debug the problem that’s coming up in the jmk_panel plugin, which is basically how it uses the DOM method insertBefore. While insertBefore takes two arguments, an element to be inserted, and a reference element, before which the new element should be inserted, the jmk_plugin only calls that with one argument. While that might work for the most part, one of the security updates with 10.12.4 seems to point that the Javascript engine in WebView is now a lot more strict.

You can resolve the issue by removing the plugin.

For people who like to keep the plugin, you can find any instances of insertBefore in the jmk_panel code and fix it. For example:

https://github.com/jamiekowalski/foldingtext-extra/blob/master/jmk_panel.ftplugin/jmk_panel.js#L306

Change line: document.body.insertBefore( this.element ); to document.body.insertBefore( this.element, null );

Note that I only added , null within the parameters. That’s all you have to do with any other instances you find in the code.

Meanwhile, I’ve made a quick-fix for FoldingText to allow you to load it without plugins if it encounters a similar issue. Going to test it a bit more and release a dev-version soon with the fix.

Hope this helps.

Regards,
Mutahhir

Hi Mutahhir,

Thank you, that works! Two small remarks:

  • The link to the repository doesn’t work; it’s probably a private repo.
  • In my case, the jmk_panel plugin was located in ~/Library/Containers/com.foldingtext.FoldingText/Data/Library/Application Support/FoldingText/Plug-Ins/jmk_panel.ftplugin (not the ‘default’ Application Support directory, not sure why)

Thanks for your support!

Kind regards,
Maarten

Hi,

That’s great to hear!

I’ve updated the link, sorry, pasted the wrong link before.

The folder path seems to be a sandbox folder, I’m not sure why I don’t have the same setup on my end. In any case, I’m glad you’ve got your workflow back to working.

Regards,
Mutahhir

I can also confirm that this fixes the problem the Jamie Kowolski’s Filter and Basic Theme plugins. I opened jmk_panel.js in a text editor and made the change described by mutahhir (I believe it was in 3 different lines). I saved the file, relaunched FT and all was well. THANKS

Hm. Tried the fix and no joy thus far. I only found two entries with the referenced code. Has anyone forked a working copy on Github yet?

I got it to work:

https://github.com/jamiekowalski/foldingtext-extra/pull/5

FYI: the fix has been merged into the main branch of Jamie’s plugin on GitHub.