Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

404
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda