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

302
Vistas
Uncaught SyntaxError: Unexpected reserved word in a {name} file

I'm in a weird situation where I get this error: Uncaught SyntaxError: Unexpected reserved word (at addLocalSkillset.js?t=1654154827218:28:21), I tried to remove the headers variable, and URL variable, but still that error is found.

In fact, if you see the file, No reserved word is being used, isn't that weird?

import { API_URL, API_KEY } from '../../../@constants/Global/Env';

const addLocalSkillset = (workSpaceId) => {

    const newSkillset = {
        skills_group: `Untitled ${Math.random().toString().substring(2, 5)}`,
        skills_set: [],
        workSpaceId: workSpaceId,
    };

    const _URL = `${API_URL}/predefinedskills`;

    const _headers = {
        'api-key': API_KEY,
        'user-token': token,
    };

    var body = new FormData();
    body.append('predefinedSkills', JSON.stringify(newSkillset));

    const requestOptions = {
        method: 'POST',
        headers: _headers,
        body: body,
    };

  try {
    const request = await fetch(_URL, requestOptions);
    const response = await request.json();
    console.log('result', response);

    if (response.status === true) {
      return {
        data: res.data,
        status: true,
        message: 'Succesfully added a skill set.',
      };
    } else {
      return {
        status: false,
        message: "Something wen't wrong adding a skill set.",
      };
    }
  } catch (error) {
    return {
      status: false,
      message: "Something wen't wrong adding a skill set.",
    };
  }
}

export default addLocalSkillset;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Add async when declaring the function just before the variables

const addLocalSkillset = async (workSpaceId) => {
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