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

96
Views
SyntaxError: Unexpected identifier 'supabase'. Expected ';' after variable declaration

I am trying to delete a row from the database and when I load the page, the file throws an error saying SyntaxError: Unexpected identifier 'supabase'. Expected ';' after variable declaration.

Following is my function code:

window.deleteChap = async function deleteChap(x) {

  let chapid = chapids[x];

  Swal.fire({
    title: `Are you sure you want to delete the chapter? This action is irreversible.`,
    showCancelButton: true,
    confirmButtonText: 'Yes, delete it!',
  }).then((result) => {
    if (result.isConfirmed) {

      const { data, error } = await supabase.from('chapters').eq('id', chapid).delete();
      
      if (error) {
        erroralert(error.message);
      } else {
        successalert(`Chapter deleted successfully.`);
      }
    }
  })

}

The supabase client has already been initialised this way:

let supabase;
$.ajax({
    url: "/keys",
    success: async function( result ) {
  
        result = JSON.parse(result);
  
        supabase = createClient(result.link, result.anon_key);

  }});

The javascript file is linked to the html with <script defer src="/js/dnovelinfo.js" type="module"></script>

I am not sure why the error is being thrown, even when I haven't interacted with the page (the page was only reloaded to see latest changes)

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