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]: Sass imports the CSS file to report an error #2689

Closed
djkloop opened this issue Jun 25, 2024 · 8 comments
Closed

[Bug]: Sass imports the CSS file to report an error #2689

djkloop opened this issue Jun 25, 2024 · 8 comments

Comments

@djkloop
Copy link

djkloop commented Jun 25, 2024

Version

System:
    OS: Linux 6.1 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (2) x64 AMD EPYC
    Memory: 2.56 GB / 4.01 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  npmPackages:
    @rsbuild/core: ^0.7.9 => 0.7.9 
    @rsbuild/plugin-sass: ^0.7.9 => 0.7.9 
    @rsbuild/plugin-vue2: ^0.7.9 => 0.7.9

Details

Sass imports the CSS file to report an error. It can be used normally when using the aliases, but the console will report to warning. The SASS plug -in should support the introduction of CSS files

Reproduce link

https://codesandbox.io/p/github/djkloop/rs-issue-vue2-demo/main

Reproduce Steps

1. pnpm i -f
2. pnpm dev
3. terminal -> error/warning

test file path

image

run warning

image

run error

image

@djkloop djkloop added the 🐞 bug Something isn't working label Jun 25, 2024
@djkloop
Copy link
Author

djkloop commented Jun 25, 2024

sass/sass#3043

sass里面应该是支持css文件导入的...看了sass的issue

@chenjiahan
Copy link
Member

Yes, it is allowed to import .css file in a .scss file, but it seems not allowed to use this in additionalData.

The codesandbox link does not match the problem you describe. Could you check the link?

@djkloop
Copy link
Author

djkloop commented Jun 25, 2024

Yes, it is allowed to import .css file in a .scss file, but it seems not allowed to use this in additionalData.

The codesandbox link does not match the problem you describe. Could you check the link?

codesanbox demo

I found a new bug, which was originally warning, but after testing, it will report an error in the CSS file to introduce font files.I left a comment in the public.scss file

@chenjiahan chenjiahan changed the title [Bug]: Sass imports the CSS file to report an error. It can be used normally when using the aliases, but the console will report to warning. The SASS plug -in should support the introduction of CSS files [Bug]: Sass imports the CSS file to report an error Jun 25, 2024
@chenjiahan
Copy link
Member

Where is public.scss? Do you forget to push the code or switch the branch?

image

Copy link
Contributor

Hello @djkloop. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️

@djkloop
Copy link
Author

djkloop commented Jun 26, 2024

@chenjiahan 可能是那个代码只在codesandbox更新了但是没有push到源仓库,我现在重新从codesanbox上推上去代码了,x现在应该是好的了,你在试试
demo

@xc2
Copy link
Collaborator

xc2 commented Jul 1, 2024

@djkloop

按照 sass 的规范,在 @import css 的时候,必须不能加 .css 后缀。

所以你应该写 @import "./var3"; (同时存在 var.scssvar.css 的时候会加载 var.scss,所以我这里把 var.css 文件改名为 var3.css 了)。

另外字体文件的报错是因为 iconfont.woff 这个文件确实不存在。

@djkloop
Copy link
Author

djkloop commented Jul 2, 2024

@xc2 好的,谢谢

@djkloop djkloop closed this as completed Jul 2, 2024
@xc2 xc2 removed 🐞 bug Something isn't working need reproduction labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants