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

289
Views
selectize.js mecanografiado: no se pueden leer las propiedades de undefined (leyendo '0')

Estoy tratando de implementar selectize.js dentro de mi proyecto con webpack y mecanografiado.

Primero instalé selectize.js y tipos relacionados:

 yarn add @selectize/selectize yarn add @types/select2

En mi código inserté esto:

 require("selectize")(); jQuery(function($){ $(document).ready(function(){ $('.classic-select').selectize(); }); });

El código compila correctamente pero cuando voy a ejecutarlo en consola me sale este error y no entiendo a que se refiere:

 Cannot read properties of undefined (reading '0')

¿Puedes ayudarme a resolver este problema?

Gracias de antemano danilo

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Después de varios intentos, descubrí cómo implementar correctamente selectize.

Primero importé jquery y seleccioné así:

 import $ from 'jquery'; import 'selectize'; // globally assign select2 fn to $ element

Luego usé selectize

 jQuery(function($){ $(document).ready(function(){ (<any>$('.classic-select')).selectize(); }); });

También puedes implementarlo así

 $(() => { (<any>$('.classic-select')).selectize(); });

Si compila el código, también se importará la biblioteca jquery. Si ya se ha llamado a jquery en su código, puede excluirlo de la compilación a través del paquete web:

 externals: { jquery: 'jQuery' }

¡Espero que sea útil!

about 4 years ago · Santiago Gelvez 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!