Uncaught TypeError: $(...).modal is not a function
See original GitHub issue- Laravel Mix Version: #.#.# (
npm list --depth=0
)
npm list --depth=0
+-- @ladjs/bootstrap-social@7.0.2 (github:niftylettuce/bootstrap-social#f7d456c7982cdd865a8ac75025a5e68b4c71c925)
+-- axios@0.17.1
+-- bootstrap@4.0.0
+-- cross-env@5.1.3
+-- font-awesome@4.7.0
+-- jquery@3.3.1
+-- laravel-mix@1.7.2
+-- lodash@4.17.4
+-- popper.js@1.13.0
`-- vue@2.5.13
- Node Version (
node -v
):
node -v
v8.9.4
- NPM Version (
npm -v
):
npm -v
5.6.0
- OS: Windows with HomeStead ( npm / node running on the host )
Description:
Steps To Reproduce:
With a fresh laravel install i’m trying to display a bootstrap modal but i get this error :
(index):181 Uncaught TypeError: $(...).modal is not a function
at (index):181
$('#exampleModalCenter').modal({
show: true
});
I’m new to webpack / laravel-mix / … And i don’t know how to get more information. In app.js I found this :
But still doesn’t work.
php artisan --version
Laravel Framework 5.5.28
Thanks for your help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
TypeError: $(...).modal is not a function with bootstrap Modal
This error is actually the result of you not including bootstrap's javascript before calling the modal function. Modal is defined in ...
Read more >Uncaught TypeError: $(…).modal is not a function jquery
The $(…).modal is not a function is usually caused because scripts are loaded in the wrong order . The browser will execute the...
Read more >Uncaught TypeError: $(...).modal is not a function - jQuery Forum
Hello Everyone, I am using jquery in react and i am facing this issue. My code is showFileUploadModal(roleType){ console.log(roleType); ...
Read more >Bootstrap modal is not a function | Edureka Community
When I call my model in windows it gives an error to the console. This is the error: $(...).modal is not a function....
Read more >TypeError: $(...).modal is not a function - MSDN - Microsoft
User81789783 posted. i have an error subjected of thread .. here is code @{ ViewBag.Title = "CreateTopic"; Layout = null; } <head> <link ......
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
Hi @Crupuk,
Bootstrap 4 no longer uses module definitions for the core JavaScript, instead, you now need to explicitly expose each static module by using the below.
This could be adapted to
mix.autoload
but I haven’t had a chance to test it fully.NOTE: Make sure you have the
exports-loader
package installed as it’s required for this to work.Ref: https://medium.com/@estherfalayi/setting-up-webpack-for-bootstrap-4-and-font-awesome-eb276e04aaeb
jquery/dist/jquery.slim
change tojquery
will work