4

I am getting the following error with bootstrapDialog. I am just initializing the bootStrapDialog i.e. BootstrapDialog.alert('I want banana!');

Can anyone help me on how to resolve?

Browser throws the error as follows:

Uncaught TypeError: element.querySelector is not a function
at n.Modal (modal.js:80)
at new n (bootstrap-dialog.min.js:1)
at o.realize (bootstrap-dialog.min.js:1)
at open (bootstrap-dialog.min.js:1)
at Function.o.alert (bootstrap-dialog.min.js:1)

bootstrap:

bootstrap-4.1.3/js/bootstrap.js


bootstrap3-dialog:

     <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/js/bootstrap-dialog.js"></script>
Ramana
  • 61
  • 1
  • 6
  • Welcome to Stack Overflow! Please read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) I also recommend Jon Skeet's [*Writing the perfect question*](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) and [question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). We can't help you with code we can't see. It sounds as though you're trying to call a Bootstrap dialog method on an element that doesn't exist, but it's hard to say more than that... – T.J. Crowder Sep 24 '18 at 09:51
  • I am getting the querySelection not a function error in the browser, while initializing the bootstrapDialog initialization and calling alert the function. – Ramana Sep 24 '18 at 11:45
  • 1
    I'm getting the same error. Quite confusing. – Rhys van der Waerden Oct 15 '18 at 00:31
  • @Ramana were you able to fix this issue? I'm still stuck with this. – Somebody Jul 03 '19 at 16:16

1 Answers1

5

I hit this issue as a result of updating to bootstrap 4 but retaining bootstrap3-dialog. boostrap4-dialog appears to fix the issue.

Rhys van der Waerden
  • 3,526
  • 2
  • 27
  • 32