Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda