Bootstrap 4:未捕获的 ReferenceError:未定义 Popper [英] Bootstrap 4: Uncaught ReferenceError: Popper is not defined

查看:16
本文介绍了Bootstrap 4:未捕获的 ReferenceError:未定义 Popper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Node 和 Gulp 安装了 Bootstrap 4,在运行应用程序时出现以下错误

I've installed Bootstrap 4 using Node and Gulp and when running the application I get the following error

未捕获的引用错误:未定义 Popper

Uncaught ReferenceError: Popper is not defined

到目前为止,我只使用了 Bootstrap 网格系统,我还没有使用任何需要 Bootstrap JS 的东西.在我看来,Bootstrap 缺少某些东西,或者我没有正确安装它(老实说,这可能是我) - 有没有其他人遇到过同样的问题或根本不知道修复方法?

I've only been using the Bootstrap grid system so far and I haven't used anything that would require the Bootstrap JS. Looks to me like Bootstrap is missing something or I haven't installed it correctly (to be honest it's probably me) - has anyone else come across the same issue or know a fix at all?

推荐答案

自 Bootstrap beta 2 发布以来,我们添加了两个新的 dist 文件:bootstrap.bundle.jsbootstrap.bundle.min.js 里面包含 Popper.js

Since our Bootstrap beta 2 release, we added two new dist files : bootstrap.bundle.js and bootstrap.bundle.min.js which contain Popper.js inside

另外使用此链接查找最新版本的 Popper.js:https://cdnjs.com/library/popper.js 因为上面链接的版本(1.8.2)很旧,最新的是1.12.9

Plus use this link to find the latest release of Popper.js : https://cdnjs.com/libraries/popper.js because the above linked release (1.8.2) is very old, latest is 1.12.9

顺便说一句,您应该选择 Popper.js 的 UMD 版本,因为它是 Bootstrap 使用的版本

BTW you should choose the UMD release of Popper.js because it's the one used by Bootstrap

这篇关于Bootstrap 4:未捕获的 ReferenceError:未定义 Popper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆