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

357
Visualizações
Getting JS error after changing versions: Uncaught ReferenceError: Xyz is not defined

I was using react-vis library. Their readme file says following:

If you're working in a non-node environment, you can also directly include the bundle and compiled style using basic html tags.

<link rel="stylesheet" href="https://unpkg.com/react-vis/dist/style.css">
<script type="text/javascript" src="https://unpkg.com/react-vis/dist/dist.min.js"></script>

The global reactVis object will now be available for you to play around.

When I do exactly that, it works and I was able to use reactVis object in my code. It links versions 1.11.7 from unpkg. I wanted to try out version 1.11.5. So, I tried following:

<link rel="stylesheet" href="https://unpkg.com/react-vis@1.11.5/dist/style.css">
<script type="text/javascript" src="https://unpkg.com/browse/react-vis@1.11.5/dist/dist.min.js"></script>

But, now it gives me following error:

Uncaught ReferenceError: reactVis is not defined

Somehow, it is not able to get reference to reactVis code. Why is this so?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The link you used contains https://unpkg.com/browse/... /browse links to the html preview page of the file.

To link to the raw version of the file remove /browse in your case to https://unpkg.com/react-vis@1.11.5/dist/dist.min.js, which would link to the file raw.

eg.

console.log(
  reactVis
)
<link rel="stylesheet" href="https://unpkg.com/react-vis@1.11.5/dist/style.css">
<script type="text/javascript" src="https://unpkg.com/react-vis@1.11.5/dist/dist.min.js"></script>

about 4 years ago · Juan Pablo Isaza Relatório
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