Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

catch error `module must start with either "/", "./", or "../"`

$
0
0

Example

<!-- index.html -->
<script type="module">
    import 'someModule'</script>

TypeError: Error resolving module specifier: someModule


Uncaught TypeError: Failed to resolve module specifier "someModule". Relative references must start with either "/", "./", or "../".


Q:

  1. Is it possible to catch this error?
  2. Who dispatch this error?

Context

In this case, the dependency can be caught and resolved using the service worker.

<script type="module">
    import '/someModule'</script>

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>