Cannot read property 'valHooks' of undefined

See original GitHub issue

Hello,

I installed the plugin throw npm and added the html tags to the header:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/css/bootstrap-select.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.min.js"></script>

However I get the error:

Uncaught TypeError: Cannot read property 'valHooks' of undefined
    at bootstrap-select.min.js:7
    at bootstrap-select.min.js:8
    at bootstrap-select.min.js:7
    at bootstrap-select.min.js:7

does anybody know about this?

Regards.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

28reactions
caseyjholcommented, Dec 29, 2016

What version of jQuery are you using? You need to load jQuery before bootstrap-select.min.js.

10reactions
geralddevelopcommented, Oct 7, 2020

I have solve the issue on my side by adding defer into the script.

<link defer rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>

I hope this helps you all to solve the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property '3' - Stack Overflow
Hi Drifter I have tried your example with following scripts and css. I didn't get any error. Hope there are some version compatibility ......
Read more >
Problem with select input - Material Design for Bootstrap
Hey Guys,i've created a material select like in the docs but the menu don't open. I only get this error message: Uncaught TypeError:...
Read more >
Uncaught TypeError Cannot read property fn of undefined
I am using jquery, backbonejs, underscorejs, and bootstrap for my project and I sometimes get this error in chrome.
Read more >
Uncaught TypeError: Cannot read properties of undefined ...
Hello. After the latest updates, I have this problem in the console. `Uncaught TypeError: Cannot read properties of undefined (reading 'hooks')
Read more >
bootstrap-select - npm
The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found