0

I have upgraded my one ASP.NET Core project from VS2015 to VS2017. As a result, the jquery was upgraded from 2.2.3 to 3.2.1 and Bootstrap was upgraded from 3.3.6 to 3.3.7. Now I'm getting the following error:

Error

Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Snapshot of Error in Google Chrome's Dev Tool:

enter image description here

On the other hand VS2017 is not allowing me to downgrade Bootstrap from 3.3.6 to a version lower than 3 (also explained here why).

Question: How do I resolve the above issue? I'm stuck at the home page of the app where the issue occurs.

nam
  • 21,967
  • 37
  • 158
  • 332
  • I saw this on a site I was working on when I was using bind() and unbind() that is not supported in JQ3. That may be what is happening happening with bs. https://api.jquery.com/category/deprecated/deprecated-3.0/ – Elim Garak Jun 30 '17 at 22:34
  • @RegencySoftware I tried downgrading to `JQ 2.2.3` but can't downgrade `BS` to lower than 3.0 - and hence the issue is still there. But interesting to know that someone else has encountered a similar issue. – nam Jul 01 '17 at 01:35
  • Huh, didn't you read the error message? The error message says that you need to downgrade **jQuery** to 2.x, **NOT** Bootstrap. when 3.3.7 can't work with jQuery 3, then 3.3.6 or 3..0 won't do it either since it's **older**.. **If anything** then you need to **upgrade** Bootstrap to i.e. 4.0 which is **newer** than 3.3.6 and may support jQuery 3 – Tseng Jul 01 '17 at 12:21
  • Just from the Bootstrap Website: https://v4-alpha.getbootstrap.com/getting-started/introduction/ Bootstrap 4 Alpha does support/require jQuery 3.x – Tseng Jul 01 '17 at 12:22

1 Answers1

0

As the error message says, the jQuery version is too new for Bootstrap 3.3.x to use.

You have two options:

  1. Downgrade jQuery the latest 2.x version
  2. Upgrade Bootstrap to 4.x (see here) which requires to run on jQuery 3
  3. Don't use the bootstrap.js at all and use ngx-bootstrap (only if you are using Angular >= 2, since it replaces the jQuery functions with a better integrated angular 2 directives)
Tseng
  • 61,549
  • 15
  • 193
  • 205