1

Angular 给出了错误: bootstrap 4 中的 popper.js 给出了 SyntaxError Unexpected token export

我从浏览器控制台收到此错误。

即使我更改了 popper.min.js 位置参考但没有用..

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

1 回答 1

5

bootstrap.min.js 依赖于 popper.min.js ,改变顺序如下,

   "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",
   ]
于 2018-10-28T04:47:52.353 回答