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

153
Views
Javascript library ALASQL runs local but "is not defined" error once ran as an installed Chrome Extension

As I said, this runs locally fine (ie if I kick it off from VS Code). But when it is installed as an Extension I get

"Uncaught ReferenceError: alasql is not defined at saveFile (index.js:168:19)"

I included these scripts in my html file:

        <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.7.12/xlsx.core.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/alasql/0.4.2/alasql.min.js"></script>

index.js file

window.saveFile = function saveFile () 
{
        var data1 = [{a:"city1",b:10},{a:"city2",b:20}];
        var data2 = [{a:100,b:10},{a:200,b:20}];
        var opts = [{sheetid:'One',header:true},{sheetid:'Two',header:false}];
        var res = alasql('SELECT * INTO XLSX("restest344b.xlsx",?) FROM ?',
                         [opts,[data1,data2]]);

}
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!