Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: import css 在非首页无法引入 #5144

Open
erguotou520 opened this issue Dec 25, 2023 · 0 comments
Open

[Bug]: import css 在非首页无法引入 #5144

erguotou520 opened this issue Dec 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@erguotou520
Copy link

版本信息

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 82.77 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Browsers:
    Chrome: 120.0.6099.129
    Safari: 15.6
  npmPackages:
    @modern-js/app-tools: 2.43.0 => 2.43.0 
    @modern-js/builder-rspack-provider: 2.43.0 => 2.43.0 
    @modern-js/eslint-config: 2.43.0 => 2.43.0 
    @modern-js/runtime: 2.43.0 => 2.43.0 
    @modern-js/tsconfig: 2.43.0 => 2.43.0

问题详情

在首页引入一个组件,组件中引入一个css,那么该css能被成功加载。
但是如果在非首页引入同一个组件,那么该css不能被成功加载。
另外我试了下在2个page页面中直接引入css文件也是同样的问题。

复现链接

https://github.com/erguotou520/modern-css-issue

复现步骤

  1. 安装依赖
  2. 运行`pnpm dev
  3. 打开首页,Hello组件文字显示红色
  4. 点击to Hello,查看子页面文字颜色非红色,也不是蓝色
@erguotou520 erguotou520 added the bug Something isn't working label Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant