V
V
VovaSakay2021-05-05 10:30:26
JavaScript
VovaSakay, 2021-05-05 10:30:26

Why is my plugin not working?

My jquery plugin written in typescript
Problem
I include my plugin on the page. When I import my plugin written in typescript, everything works. But when I import the same plugin already compiled (I import as a js file) file, it writes in the browser console - Uncaught TypeError: $(...).rangeSlider is not a function.

What have I tried?
1. Initialization of the plugin in this construction ( ) 2. Connected another file that simply executes another jquery code - the code works 3. - this line does not break anything) Plugin itself Page file, initialization$(document).ready(function(){});
const $: any = jQuery;

609248dc9f3ee592201473.png

609249291b696253830816.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VovaSakay, 2021-05-06
@VovaSakay

I have @types-jquery, and this code in webcam broke everything

new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'window.jQuery': 'jquery',
      'window.$': 'jquery',
    }),

Stupid @types-jquery does everything by itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question