Bootstrap 4.0 current git no longer works in WordPress TypeError: $ is undefined
See original GitHub issueI had this working before. I enqueued the scripts in a correct way but now it no longer works.
This may have to do with the fact that WP loads jQuery in noConflict mode and BS assumes $ to be jQuery? Or with the recent rewrites?
How can I fix this?
I have outdated code running on nextgenthemes.com where this issue is also present.
Firefox Errors:
TypeError: $ is undefined[Weitere Informationen] bootstrap.js:88:5
TypeError: $(...).tooltip is not a function[Weitere Informationen]
Chrome errors:
Uncaught TypeError: Cannot read property 'fn' of undefined
at setTransitionEndSupport (bootstrap.js:88)
at bootstrap.js:151
at bootstrap.js:153
at bootstrap.js:3836
s.js:17 Uncaught TypeError: $(...).tooltip is not a function
Tried to reproduce this in JSbin with the old jQuery 1 version but that works fine.
This is it basically what I have running with everything else cut.
<!DOCTYPE html>
<html lang="en-US">
<head>
<script type='text/javascript' src='https://nextgenthemes.dev/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
</head>
<body>
<script type='text/javascript' src='https://nextgenthemes.dev/wp-content/themes/s/node_modules/popper.js/dist/umd/popper.js?ver=1.12.5'></script>
<script type='text/javascript' src='https://nextgenthemes.dev/wp-content/themes/s/node_modules/bootstrap/dist/js/bootstrap.js?ver=v4.0.0-beta'></script>
<-- script that uses tooltips -->
</body>
</html>
Issue Analytics
- State:
- Created 6 years ago
- Comments:37 (28 by maintainers)
Top Results From Across the Web
How to fix "undefined is not a function" in WordPress [duplicate]
To correct this problem, you need to either replace all instances of $ with jQuery , or wrap the entire set of functions...
Read more >Tiny Slider 2 - GitHub Pages
Option Type Description
axis “horizontal” | “vertical” Default: “horizontal”. The axis of the slider.
gutter positive integer Default: 0. Space between slides (in “px”).
edgePadding positive...
Read more >uncaught typeerror: cannot read properties of undefined (reading ...
One of the solution was to use concatenateModules: false apparently, but to no avail, it didn't solve my issue. So I tried with...
Read more >WordPress Plugins and Themes with Known Issues
A list of WordPress plugins, themes, and functions that are not supported and/or require workarounds.
Read more >Why Is jQuery Undefined? - Code - Envato Tuts+
When working with jQuery, sometimes developers like to modify the $ function so that it doesn't conflict with something else that their source ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the exact same issue and I can confirm this is working as soon as upgrading to beta 3.
we hope to ship a new beta soon and it’ll be the last beta 👍