css mode isn't loaded


I’m having trouble getting CodeMirror to work with the CSS mode. I can get Javascript, Markdown, GFM to all work fine, but for some reason modes/css/css.js never even appears to be loaded when I print out CodeMirror.modes (see screenshot below). I’m using require for this and CSS is the only one I’ve had issues with so far. This is with CodeMirror 5.61.1 on the latest version of Chrome, v 91.0.4472.77.


There’s nothing fundamentally different about css.js compared to the other modes, and this isn’t a problem I’ve seen before. You’ll have to debug or isolate this further on your own, I think.

Oof. That’s what I was afraid of.

I see the module is loaded in my browserify bundle, so the code is present. I can comment out the Markdown and JavaScript requires and they do turn off, but CSS still doesn’t work.

Just for kicks, I tried loading up Rust and cLike, and those don’t register to CodeMirror.modes either.

This is gonna be a nightmare.

I don’t know if you an point me in a better direction, but after more fiddling around, this is what I’ve found:

If I copy the contents of mode/css/css.js and paste it over the contents of mode/javascript/javascript.js, SUDDENLY CSS LOADS! Is there any possibility that a bundler like browserify is scrambling something just because of the filename?