你好 @Mr.Xurrent,我一直在尝试在本地复现该问题,但无论我的插件如何配置,都无法复现。你说只有团队发布的插件被启用,但你是否安装了其他处于禁用状态的插件?
此外,当看到错误时,能否在控制台运行以下代码并将结果粘贴到这里:
(() => {
const raw = JSON.parse(
JSON.parse(document.querySelector("#data-preloaded").textContent).site
).admin_config_login_routes;
const live = Discourse.__container__
.lookup("service:site")
.admin_config_login_routes;
return {
raw,
rawType: typeof raw,
rawConstructor: raw?.constructor?.name,
rawIsArray: Array.isArray(raw),
live,
liveType: typeof live,
liveConstructor: live?.constructor?.name,
liveIsArray: Array.isArray(live),
liveHasMap: typeof live?.map === "function",
arrayPrototypeHasMap: typeof Array.prototype.map === "function",
};
})()
此时我真的不确定你为何会获取到一个不支持 map 方法的 admin_config_login_routes 值。当我在服务器上使用 LOAD_PLUGINS=0 禁用所有插件时,我得到的是一个空数组。在其他所有情况下,我得到的都是一个包含值的数组。两者都支持 map 方法,但如果数组外部出现类似 {} 或 "oauth2" 这样的值,则会触发该错误。