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

133
Vistas
Object won't return in console

Im trying to run my API over a localhost, but when I type npm run dev the terminal shows this error message.

7  |      <title>MULTIPLE APIs</title>
8  |    </head>
9  |    <body>
   |    ^
10 |  <body class="bg-gray-100">
11 |    <h1 class= "text-bold text-6xl text center p- 
8">Multiple API Feed</h1>

When I look in Chrome Dev console it says crbug/1173575, non-JS module files deprecated. (anonymous) @ (index):7290

[vite] Internal server error: Unable to parse {"file":"/index.html","line":9,"column":3}

Here is my index.html file below

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" 
href="favicon.svg" />
    <meta name="viewport" content="width=device-width, 
initial-scale=1.0" />
    <title>MULTIPLE APIs</title>
  </head>
  <body>
<body class="bg-gray-100">
  <h1 class= "text-bold text-6xl text center p- 
 8">Multiple API Feed</h1>
<div id ="app" class="min-h-screen flex flex-col 
justify-center items-center gap-2"></div>


<script type="module" src="/main.js"></script>
</body>

</html>

Here is my main.js file

    import './style.css';

    const RAPIDAPI_KEY = import.meta.env.VITE_RAPIDAPI_KEY;
    const LOVECALCULATOR_URL =
      'https://love- 
       calculator.p.rapidapi.com/getPercentage';
        const LOVECALCULATOR_HOST = 'love- 
       calculator.p.rapidapi.com';

    const getData = async (url, host) => {
      const response = await fetch(url, {
        method: 'GET',
        headers: {
          accept: 'application/json',
          'x-rapidapi-key': RAPIDAPI_KEY,
          'x-rapidapi-host': host,
        },
      });

      if (!response.ok) {
        throw new Error(`HTTP error! status: 
    ${response.status}`);
      }
      return await response.json();
    };

    const runApiQueries = async () => {
      //GET MATCHMAKER RESULTS
      const loveData = await getData(LOVECALCULATOR_URL, 
    LOVECALCULATOR_HOST);
      console.log(loveData);
        };

        runApiQueries();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There are repetitive body tags that are causing problem I believe. Please check line number 9 and 10.

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