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]: plugin-sass fails to correctly follow @forward directive #3932

Open
jowen opened this issue Nov 9, 2024 · 1 comment
Open

[Bug]: plugin-sass fails to correctly follow @forward directive #3932

jowen opened this issue Nov 9, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@jowen
Copy link

jowen commented Nov 9, 2024

Version

System:
    OS: macOS 14.3
    CPU: (12) arm64 Apple M3 Pro
    Memory: 121.75 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 130.0.6723.117
    Safari: 17.3
  npmPackages:
    @rsbuild/core: ^1.0.19 => 1.1.0 
    @rsbuild/plugin-react: ^1.0.6 => 1.0.7 
    @rsbuild/plugin-sass: ^1.1.0 => 1.1.0

Details

Build fails with error when trying to import @carbon/react styles.

× Module build failed:
╰─▶ × expected "{".
│ ╷
│ 1 │ 'use strict';
│ │ ^
│ ╵
│ ../../../@carbon/colors/lib/index.js 1:13 @forward
│ ../../../@carbon/styles/scss/\_colors.scss 8:1 @forward
│ ../../../@carbon/styles/index.scss 10:1 @use
│ ../../../../src/index.scss 1:1 root stylesheet

This is because rsbuild tries to load @carbon/colors/lib/index.js instead of @carbon/colors/index.scss when trying to follow @forward @carbon/colors

This works correctly on webpack and next.js

Reproduce link

https://github.com/jowen/rsbuild-carbon

Reproduce Steps

npm i
npm run dev

@jowen jowen added the 🐞 bug Something isn't working label Nov 9, 2024
@inottn
Copy link
Collaborator

inottn commented Nov 10, 2024

I haven't looked into it closely, but it might be the same as this issue (web-infra-dev/rspack#8057 (comment)).

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

2 participants