javascripttypeerrorevalcdnmonaco-editor

Embedded Monaco Editor instance fails at editor.main.js = $ is not a function


I'm developing a web desktop, and I'm trying to integrate the monaco editor as an app. The first time I tried it actually worked, but then the next commit I can't figure out for the life of me what might have been the change that made this exception start happening every time.

This is the implementation I've been using: https://stackoverflow.com/a/57059229/22982296

I work with no libraries, my setup is completely vanilla, and everything is front end.

You can see the error in action at: https://pentacoro.github.io/

  1. Create a text document
  2. Change its extension to ".js"
  3. Open it and check your browser's developer console

And I reiterate, it worked perfectly just on the last commit, with the same setup. I tried to cross examine them but I'm truly at a loss. I guess my lesson is to commit smaller changes.

Any idea what might be happening just on the surface given the error message?

I actually have an error managing popup for failed eval()s, so when I tried to just plainly add a path to the editor.main.js file within the monaco.html, this popped up, with exactly the same error lol, so it's not an issue of the require() function.

Popup error: (https://i.stack.imgur.com/TW3Cq.png)


Solution

  • I figured it out. It was so stupid lol.

    I declared a new "String" class that extended my "File" class, and that was obviously bound to screw up way more than just monaco. Facepalm.