How to detect that import('/some-url') failed because '/some-url' isn't a JavaScript module?
My browser-side JavaScript uses a dynamic import import('/some-url') which sometimes throws an error. How can I tell whether the thrown error originates from the loaded JavaScript module, or from the browser because no JavaScript module was found at '/some-url'? The…