Uncaught SyntaxError: Unexpected token export - po

2020-04-21 05:55发布

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"
    ]

1条回答
兄弟一词,经得起流年.
2楼-- · 2020-04-21 06:51

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",
   ]
查看更多
登录 后发表回答