Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
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 answers
Answer question

0

Add async when declaring the function just before the variables

const addLocalSkillset = async (workSpaceId) => {
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!