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

301
Visualizações
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 Respostas
Responde à pergunta

0

Add async when declaring the function just before the variables

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