Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda