question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap 4.0 current git no longer works in WordPress TypeError: $ is undefined

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:37 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
ChristophAnastasiadescommented, Dec 28, 2017

I had the exact same issue and I can confirm this is working as soon as upgrading to beta 3.

1reaction
Johann-Scommented, Nov 14, 2017

we hope to ship a new beta soon and it’ll be the last beta 👍

Read more comments on GitHub >

github_iconTop 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 >

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