# 匿名用户访问 Styleguide 页面崩溃

**URL:** https://meta.discourse.org/t/styleguide-page-crashes-for-anonymous/397317
**Category:** Bug
**Created:** [2026年二月27日 22:43 UTC](https://meta.discourse.org/t/styleguide-page-crashes-for-anonymous/397317 "2026-02-27T22:43:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2026年二月27日 22:43 UTC](https://meta.discourse.org/t/styleguide-page-crashes-for-anonymous/397317/1 "2026-02-27T22:43:21Z")

</div>

当 **Styleguide allowed groups** 设置为“everyone”时，页面对已登录用户有效，但对匿名用户会崩溃：[https://canapin.discourse.diy/styleguide](https://canapin.discourse.diy/styleguide)

```plaintext
loader.js:247 Uncaught (in promise) Error: Could not find module `discourse/admin/components/highlighted-code` imported from `discourse/plugins/styleguide/discourse/components/styleguide-example`
    at loader.js:247:1
    at a (loader.js:258:1)
    at s.findDeps (loader.js:168:1)
    at a (loader.js:262:1)
    at s.findDeps (loader.js:168:1)
    at a (loader.js:262:1)
    at s.findDeps (loader.js:168:1)
    at a (loader.js:262:1)
    at s.findDeps (loader.js:168:1)
    at a (loader.js:262:1)
    at requireModule (loader.js:24:1)
    at iN (app.js:228:18)
    at iO (app.js:251:19)
    at app.js:210:21
    at iP.start (app.js:225:1)
    at HTMLDocument.<anonymous> (start-app.js:19:7)

loader.js:143 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'exports')
    at s._reify (loader.js:143:1)
    at s.reify (loader.js:130:1)
    at s.exports (loader.js:104:1)
    at s._reify (loader.js:143:1)
    at s.reify (loader.js:130:1)
    at s.exports (loader.js:104:1)
    at requireModule (loader.js:27:1)
    at O.i [as getRoute] (index.ts:121:18)

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2026年三月2日 03:15 UTC](https://meta.discourse.org/t/styleguide-page-crashes-for-anonymous/397317/2 "2026-03-02T03:15:42Z")

</div>

据我所知，这不仅是匿名用户，任何非工作人员都会遇到问题。

将根据以下内容修复：

> <https://github.com/discourse/discourse/pull/38141>
>
> The \`HighlightedCode\` component was previously located under the
> admin namespace… (\`discourse/admin/components/highlighted-code\`),
> making it awkward to use from non-admin contexts. This moves it to
> the core app namespace (\`discourse/components/highlighted-code\`)
> and replaces the old admin path with a deprecated re-export.
> 
> All existing consumers are updated to import from the new location.
> A system test is added to verify the component renders correctly
> for anonymous (non-admin) users in the styleguide.

@david / @cvx 这里的弃用是否有些过了？
