最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Uncaught SyntaxError: Unexpected token export - popper.js error - Stack Overflow

programmeradmin0浏览0评论

Angular is giving the error: popper.js in bootstrap 4 gives SyntaxError Unexpected token export

I'm getting this error from browser console.

Even I changed the popper.min.js location reference but no use..

node_modules/popper.js/dist/umd/popper.min.js

node_modules/popper.js/dist/ems/popper.min.js

Angular.json

    "scripts": [
      "node_modules/bootstrap/dist/js/bootstrap.min.js",
      "node_modules/jquery/dist/jquery.slim.min.js",
      "node_modules/popper.js/dist/popper.min.js"
    ]

Angular is giving the error: popper.js in bootstrap 4 gives SyntaxError Unexpected token export

I'm getting this error from browser console.

Even I changed the popper.min.js location reference but no use..

node_modules/popper.js/dist/umd/popper.min.js

node_modules/popper.js/dist/ems/popper.min.js

Angular.json

    "scripts": [
      "node_modules/bootstrap/dist/js/bootstrap.min.js",
      "node_modules/jquery/dist/jquery.slim.min.js",
      "node_modules/popper.js/dist/popper.min.js"
    ]
Share Improve this question asked Oct 28, 2018 at 4:45 RajathRajath 2,98810 gold badges30 silver badges46 bronze badges 1
  • when I used to "node_modules/popper.js/dist/umd/popper.min.js" umd location it is giving this error- Uncaught TypeError: Cannot read property 'fn' of undefined. For other reference it is working well esm and dist. – Rajath Commented Oct 28, 2018 at 4:51
Add a ment  | 

1 Answer 1

Reset to default 5

Bootstrap.min.js is depend on the popper.min.js , change the order as follows,

   "scripts": [
     "node_modules/jquery/dist/jquery.slim.min.js",
     "node_modules/popper.js/dist/popper.min.js",
      "node_modules/bootstrap/dist/js/bootstrap.min.js",
   ]
发布评论

评论列表(0)

  1. 暂无评论