Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

405
Vistas
How to force relative source map URL to follow redirect

I have a package parse-ingredient, which has a demo page here. The demo page depends on another of my packages called numeric-quantity. The demo page just fetches the latest UMD versions of each package from UNPKG like this:

<script src="https://unpkg.com/numeric-quantity"></script>
<script src="https://unpkg.com/parse-ingredient"></script>

Each package has a source map identified as a relative URL, like this (abbreviated version of numeric-quantity.umd.js):

(function(n,d){typeof exports=="object"&&typeof module!="undefined"? // ...etc, etc, etc
//# sourceMappingURL=numeric-quantity.umd.js.map

When the demo page is loaded in Chrome, this appears in the console:

DevTools failed to load source map: Could not load content for https://unpkg.com/numeric-quantity.umd.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Similar errors appear in other browsers. I believe this is because the browser thinks that since the original requested URL is https://unpkg.com/numeric-quantity, then the sourceMappingURL should be relative to that location, not the redirect URL that UNPKG actually resolves to (https://unpkg.com/browse/numeric-quantity@1.0.4/dist/numeric-quantity.umd.js).

Is this something I can fix with configuration? If not, is it a problem UNPKG can fix? And if not that, then is this something the browsers are actually doing wrong?

Relevant UNPKG GitHub issue

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda