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

269
Views
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 answers
Answer question

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