carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.86k stars 1.82k forks source link

[Bug]: Problems when update from carbon-components to @Carbon/react #17321

Open CaioSSilva opened 2 months ago

CaioSSilva commented 2 months ago

Package

@carbon/react

Browser

Chrome

Package version

11

React version

17.0.2

Description

Hi! Im trying to upgrade the carbon version of my project, from 7 to the most recent, following the migration docs it says to switch from the old packages, i already switched, update the imports using the "@import @carbon/react" and i did it too in all the bunch of components who need it. When i go update the global styles, it gives a bunch of errors, details below:

NextJS Version: 12.3.2

1 | @use '@carbon/react';

sassOptions: { includePaths: [path.join(__dirname, 'src', 'styles', 'node_modules')], prependData: @import "carbon-components/scss/globals/scss/vendor/@carbon/layout/scss"; @import "colors"; @import "spaces";, },

Error: Can't find stylesheet to import. ╷ 1 │ @use '@carbon/react'; │ ^^^^^^^^^^^^^^^^^^^^ ╵ src/styles/_carbon.scss 1:1 root stylesheet

Reproduction/example

.......not able to share........

Steps to reproduce


1 | @use '@carbon/react';

sassOptions: { includePaths: [path.join(__dirname, 'src', 'styles', 'node_modules')], prependData: @import "carbon-components/scss/globals/scss/vendor/@carbon/layout/scss"; @import "colors"; @import "spaces";, },

Error: Can't find stylesheet to import. ╷ 1 │ @use '@carbon/react'; │ ^^^^^^^^^^^^^^^^^^^^ ╵ src/styles/_carbon.scss 1:1 root stylesheet

Suggested Severity

None

Application/PAL

No response

Code of Conduct

tay1orjones commented 2 months ago

@CaioSSilva This feels like it's most likely an issue with your config, but without a reproduction it's hard to know where to try and look for a fix.

I did find this though: https://github.com/vercel/next.js/issues/20271#issuecomment-778838689