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
: 88 At:- 6/11/2020 4:02:51 PM
Javascript bootstrap unexpected token 'export' popper min js unexpected token 'export' popper






1 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

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






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

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly