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

SASS import error when adding carbon-components to nextjs with turbopack #73103

Open
krab7191 opened this issue Nov 22, 2024 · 0 comments
Open
Labels
bug Issue was opened via the bug report template. Turbopack Related to Turbopack with Next.js.

Comments

@krab7191
Copy link

Link to the code that reproduces this issue

https://github.com/krab7191/turbopack-sass-carbon-issue

To Reproduce

  1. Create a new nextjs project and choose to use Turbopack
  2. Adjust React & React DOM versions to 18.2.0 as required peer deps
  3. Follow instructions to add carbon-components (step 1)

Current vs. Expected behavior

When running npm run dev the following error appears:

Error evaluating Node.js code
Error: Can't find stylesheet to import.
  ╷
1 │ @use '@carbon/react';

When changing the sass use statement to @use '@carbon/react/index.scss'; the error changes to:

Error evaluating Node.js code
Error: Can't find stylesheet to import.
  ╷
8 │ @forward '@carbon/colors';

Removing the --turbopack option from the "dev" script and restarting makes everything render properly, aka the button appears on the page.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 21.7.3
  npm: 10.5.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.3 // Latest available version is detected (15.0.3).
  eslint-config-next: 15.0.3
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.6.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

@krab7191 krab7191 added the bug Issue was opened via the bug report template. label Nov 22, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant