-
Notifications
You must be signed in to change notification settings - Fork 3.5k
安装payloadcms到本地运行发现SCSS 样式文件导入失败 #16159
Copy link
Copy link
Open
Labels
area: uiRelated to the admin panel.Related to the admin panel.status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Describe the Bug.
需要确认样式冲突问题,报错500
Reproduction Steps
Bug 复现步骤模板
环境信息
- **操作系统**: Windows 11
- **Next.js 版本**: 16.2.1
- **Payload CMS 版本**: 3.81.0复现步骤
-
初始化项目
git clone <repository-url> cd xiangfeng pnpm install
-
启动开发服务器
pnpm dev # 或 npm run dev -
访问页面
- 打开浏览器访问
http://localhost:3000
- 打开浏览器访问
-
触发错误
- 页面加载时出现 500 错误
- 终端显示 SCSS 编译错误:
Error: Can't find stylesheet to import. @import 'vars';
预期行为
页面正常加载,AdminBar 组件正确渲染。
实际行为
页面返回 500 错误,SCSS 编译失败。
截图
相关代码
// src/components/AdminBar/index.scss (问题文件)
@import '~@payloadcms/ui/scss';
.admin-bar {
@include small-break {
display: none;
}
}Environment Info
最新版本
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: uiRelated to the admin panel.Related to the admin panel.status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet