mistic100 / Bootstrap-Confirmation

Bootstrap plugin for on-place confirm boxes using Popover
http://bootstrap-confirmation.js.org
307 stars 124 forks source link

Uncaught Error: Confirmation requires popover.js #171

Closed ppazos closed 1 year ago

ppazos commented 1 year ago

Included the library and there is no definition of popover inside, it's popper

But bootstrap-confirmation looks for 'popover':

if(!$.fn.popover)throw new Error("Confirmation requires popover.js");

In the examples, it uses Bootstrap 3 which included popover inside, so this doesn't work with bootstrap 4 that doesn't include that.

mistic100 commented 1 year ago

Be sure to check the dependencies https://bootstrap-confirmation.js.org/#installation (BT 5 is not supported)

If you don't use the full bootstrap bundle you need to include popover.js

ppazos commented 1 year ago

@mistic100 UPDATE: In the examples, it uses Bootstrap 3 which included popover inside, so this doesn't work with bootstrap 4 that doesn't include that.

I'm using BS4

ppazos commented 1 year ago

BTW, I already checked the dependencies, if you go to a CDN and look for popper you will see there is no "popover" element there. See for yourself: https://cdnjs.com/libraries/popper.js/1.16.1

Included the library and there is no definition of popover inside, it's popper

mistic100 commented 1 year ago

Popover is part of Bootstrap https://getbootstrap.com/docs/4.1/components/popovers/

https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.js (search popover)

ppazos commented 1 year ago

@mistic100 let me check

Though in your dependencies you have:


  "peerDependencies": {
    "bootstrap": "^4.0.0",
    "jquery": "1.9.1 - 3",
    "popper.js": "^1.16.1" <<<<< see?
  }
mistic100 commented 1 year ago

Why do you insist ons showing me popper ? Popper and Popover are not the same thing, and Popover is part of Bootstrap.

I think you use the wrong version of Confirmation, because the error message you quote has changed https://github.com/mistic100/Bootstrap-Confirmation/blob/master/src/popover.js#L5 you must use version 4.2.1 not 2.4.4

ppazos commented 1 year ago

@mistic100 not insisting, just mentioned that is actually in your package.json file...

https://github.com/mistic100/Bootstrap-Confirmation/blob/master/package.json#L31

Maybe it shouldn't?

ppazos commented 1 year ago

I have updated the bootstrap file, I'm getting a different error now.

Screenshot_2023-05-27_15-49-15

mistic100 commented 1 year ago

you will have to setup a live demo of your setup because here I can't do anything for you

and with unminified files

ppazos commented 1 year ago

I know what's the problem, I had an old bootstrap-confirmation version on the project, just updated to a newer one and the error mentioned above went away, also the confirm worked as expected. Thanks.

mistic100 commented 1 year ago

Yeah that's what I said above

I think you use the wrong version of Confirmation, because the error message you quote has changed https://github.com/mistic100/Bootstrap-Confirmation/blob/master/src/popover.js#L5 you must use version 4.2.1 not 2.4.4