Disable Cloudflare's Rocket Loader. It breaks things here because it's deferring loading of scripts.
To do that go on you Cloudflare page to Speed>Optimization and toggle Rocket Loader there.
I haven't tested it, but you can also try excluding your specific script from asynchronous loading by adding
data-cfasync="false"attribute to the script tag, but I think the issue is with jQuery being loaded after your script so I don't think this would fix it (adding this to jQuery script tag should work, but it requires modifying the theme, I think. Or something else in NodeBB code)
After I turn off the Rocket Loader of Cloudflare, all script works now, thank you very much.