# 移动导航栏下拉菜单关闭时会引发控制台错误

**URL:** https://meta.discourse.org/t/mobile-navigation-bar-dropdown-throws-console-error-on-close/321047
**Category:** Bug
**Created:** [2024年八月10日 18:11 UTC](https://meta.discourse.org/t/mobile-navigation-bar-dropdown-throws-console-error-on-close/321047 "2024-08-10T18:11:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [2024年八月10日 18:11 UTC](https://meta.discourse.org/t/mobile-navigation-bar-dropdown-throws-console-error-on-close/321047/1 "2024-08-10T18:11:01Z")

</div>

**优先级/严重性** ：  
非常低 - 对用户体验没有明显影响。但是，这会让任何使用 `addNavigationBarItem` pluginAPI 的人受到惊吓。

**平台** ：  
在 Firefox 和 Chrome 的响应式模式、移动网站视图中复现。  
在具有调试日志记录的站点和安全模式下可见效果。

**描述** ：  
当用户在移动网站视图中关闭导航栏下拉菜单时（通过单击链接或单击下拉菜单外部），Ember 会在控制台中抛出未捕获的错误。对网站的实际功能没有明显影响。

```plaintext
Uncaught (in promise) Error: Assertion Failed: You attempted to remove a function listener which did not exist on the instance, which means you may have attempted to remove it before it was added.

```

该问题已在本地开发环境、主题创建者站点（安全模式下）中观察到。

**可复现步骤** ：

1. 在移动网站上转到任何带有导航栏/下拉菜单的页面（最新、顶部等）。
2. 打开下拉菜单。
3. 关闭下拉菜单（通过单击下拉菜单外部或单击其中一个链接）。

* * *

这是一个优先级非常低且对普通用户没有影响的错误。但是，当我通过 `addNavigationBarItem` pluginAPI 添加导航项时，它确实让我大吃一惊，因为它发生时，我以为我搞砸了一切。
