[Solved] SyntaxError: Unexpected token ‘const’ [closed]


You are saying

if(!Events.includes(event.name))
const L = file.split("/");

Which doesn’t make sense because const is block scoped. You forgot {}

if (event.name) {
   if(!Events.includes(event.name)) {
       const L = file.split("/");
       return Table.addRow(`${event.name || "MISSING"}`, `⛔ Event name is either invalid or missing ${L[6] + `/` + L[7]}`);
    }
}

solved SyntaxError: Unexpected token ‘const’ [closed]