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

271
Visualizações
Cannot access jQuery in TypeScript

I am experimenting with TypeScript. I wanted to clean up my files by importing and exporting functions. But I need jQuery, so I imported it using import * as $ from './jquery';. But I get this error:

Uncaught TypeError: $ is not a function

What have I done wrong?

Thank you!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Downloading the js file is not something that in modern JS happens anymore. One would expect to set up the project with npm and use a bundler.

In any way, you have two alternatives:

  • declare const $, on the top of the file. This won't activate the IntelliSense suggestions but will prevent TypeScript to complain about the missing symbol

  • npm i --save-dev @types/jquery, if you are already using npm, will download the type definitions for jQuery and activate the IntelliSense suggestions

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