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

172
Views
ParseError: 'import' and 'export' may only appear at the top level

using Node.js I installed the JSHint package and wrote the following options in the .jshintrc file:

{
"version": 9,
"camelcase": false,
"undef": true,
"unused": false,
   "global": {
     "window": true
   }
}

Next I run build task within gulpfile.js

function lint_client() {
    return src('./client/js/Controller_ui.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
}

function browserify_client() {
    return src('./client/js/Controller_ui.js')
        .pipe(browserify({
            insertGlobals: true
        }))
        .pipe(rename('Controller_ui.js'))
        .pipe(dest('./public'));
}

exports.build = series(lint_client, browserify_client);

Above COntrollef_ui.js file content is:

import $ from 'jquery';

$(window).ready(function(){
    console.log('äö');
});

and the message with the problem I have, is in the console:

/workspace/deploy-contracts/client/js/fake_f2c8a270.js:2
import $ from 'jquery';
^
ParseError: 'import' and 'export' may only appear at the top level

or

/workspace/deploy-contracts/client/js/fake_f2c8a270.js:2
import { $ } from 'jquery';
^
ParseError: 'import' and 'export' may only appear at the top level

Is it about the top level of a tree or do I not understand? How to solve or delete the error?

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!