Open eismail-aiopsgroup opened 4 months ago
Yes, this been an intermittent issue for years now. We use moncao from cdn to avoid the hassle that comes with setting up web workers on sfcc as well as keeping the editor itself current.
It has been a few years since I've visited this issue, so maybe it is easier to dp now. If I can get some time to experiment, I will. Otherwise, a PR is always welcome if you're feeling up to it!
Very often critical resources like
https://unpkg.com/monaco-editor@0.50.0/min/vs/loader.js
cannot be fetched (502 Bad Gateway) and because of that, the console fails to load. I'm not sure if the cartridge is requesting this file, or it's loaded by an NPM package but perhaps it's better to have them stored locally if possible.The page tries to load for a minute:
When not being able to fetch the JS file, the editor is not available:
The same happens with files like:
https://unpkg.com/monaco-editor@0.50.0/min/vs/editor/editor.main.css
, too.https://unpkg.com/monaco-editor@0.50.0/min/vs/base/common/worker/simpleWorker.nls.js
So it looks like there's something wrong with unkp.com. As a workaround, I open the failed files in the browser directly, and it helps for the next load. But even in this case, I'm sometimes receiving a bad gateway error.