Console error "Syntax error Unexpected token 'export' popper.min.js"


I am using below scripts in my page and have included popper.min.js using CDN but getting an error, "Syntax error Unexpected token 'export' popper.min.js"

    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.full.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/popper.min.js"></script>

Here is the error image, take a look

unexpected-token-popper-min-js-error-min.png

How can I resolve the above issue?


Asked by:- Vinnu
0
: 5175 At:- 6/11/2020 4:02:51 PM
Javascript bootstrap unexpected token 'export' popper min js unexpected token 'export' popper







2 Answers
profileImage Answered by:- vikas_jk

Instead of using CDN link, download popper.min.js in your project and then use it.

You can download it from link

https://getbootstrap.com/docs/4.1/assets/js/vendor/popper.min.js

and then use it as

<script src="~/Scripts/popper.min.js"></script>

OR

It it still doesn't work, make sure Order of your scripts as below

<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="~/Scripts/jquery-3.0.0.min.js"></script>
<script src="~/Scripts/umd/popper.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>

Because Bootstrap 4 requires popper.min.js

1
At:- 6/12/2020 2:07:34 PM


profileImage Answered by:- Vinnu

Above solution is perfect, but you can also use Bootstrap Bundled JS files (bootstrap.bundle.js and minified bootstrap.bundle.min.js) which include [Popper](https://popper.js.org/), but not jQuery.

0
At:- 7/21/2022 6:10:44 AM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use