firenvim icon indicating copy to clipboard operation
firenvim copied to clipboard

firenvim stopped working on freeCodeCamp ("window.monaco is undefined")

Open sreckoostojic opened this issue 4 years ago • 3 comments

  • OS Version: Arch Linux 5.10.7-arch1-1 x86-64
  • Browser Version: Mozilla Firefox 86.0 (64-bit)
  • Browser Addon Version: 0.2.4
  • Neovim Version: v0.4.4
  • Neovim Plugin Version: commit 3e3d3c1dc50cc97905e56303e2dd0ca2152d5d67 (latest)
  • What I tried to do: An exercise on freecodecamp.org
  • What happened: On the 2nd of March I was happily typing away in firenvim overlaid on top of freeCodeCamp's instance of the Monaco editor, the next day whenever I tried to open a page with an editor on freeCodeCamp the firenvim window would flash briefly and then disappear. This continues to happen any time firenvim tries to appear over the input field, either automatically or by manually pressing the plugin shortcut to take over the field. Each time this happens the same two errors appear in the browser's console:

Error: window.monaco is undefined frame.ts:273:20 Uncaught (in promise) undefined frame.ts:275:12 image

As far as I can remember I did not update Firefox and Nvim, I did not update the Firefox Addons / Nvim Plugins, nor did I tweak my configuration between it working one day and not working the next.

Assistance would be greatly appreciated because writing code in the browser without firenvim is just not the same. ; )

sreckoostojic avatar Mar 06 '21 21:03 sreckoostojic

It looks like freecodecamp changed the way they deliver their javascript libraries. I can see a MonacoEnvironment global variable in their window's context - the fix might be as simple as using that in getContent, getLanguage and setContent if window.monaco isn't defined.

I won't have time to work on this myself but feel free to open a PR if applying this change fixes your problem. I wrote a guide about contributing to Firenvim here :).

glacambre avatar Mar 07 '21 02:03 glacambre

I am wondering if there is any update on this issue.

vimkim avatar Nov 20 '22 17:11 vimkim

No, there isn't.

glacambre avatar Nov 20 '22 18:11 glacambre