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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building @mui/base breaks due to deprecated csstype.Property.ColorAdjust #31296

Closed
2 tasks done
c3-william-peng opened this issue Mar 3, 2022 · 24 comments
Closed
2 tasks done
Labels
bug 馃悰 Something doesn't work package: base-ui Specific to @mui/base typescript

Comments

@c3-william-peng
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

When running ttsc -b I am seeing the following errors:

node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:146:54 - error TS2694: Namespace '"/Users/william.pengc3.ai/Projects/c3vsce/c3vsce/extension/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

146             colorAdjust?: import("csstype").Property.ColorAdjust | undefined;
                                                         ~~~~~~~~~~~

node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:651:65 - error TS2694: Namespace '"/Users/william.pengc3.ai/Projects/c3vsce/c3vsce/extension/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

651             WebkitPrintColorAdjust?: import("csstype").Property.ColorAdjust | undefined;
                                                                    ~~~~~~~~~~~

Found 2 errors.

Looking into csstype I see that they released a new version today from MDN data, which does not have the color-adjust property anymore.

MDN docs also suggest that color-adjust is gone, as the page redirects instead to print-color-adjust.

The solution is probably to update import("csstype").Property.ColorAdjust to import("csstype").Property.PrintColorAdjust, but in any case, this is breaking our builds.

Expected behavior 馃

No errors should be outputted

Steps to reproduce 馃暪

Steps:

  1. Include @mui/base in dependencies
  2. Run ttsc -b

Context 馃敠

We are trying to build our project with ttsc -b which has an indirect dependency on @mui/base

Your environment 馃寧

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@c3-william-peng c3-william-peng added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 3, 2022
@siriwatknp siriwatknp added bug 馃悰 Something doesn't work package: base-ui Specific to @mui/base typescript and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 4, 2022
@pulkitvyas08
Copy link

Facing this issue on Vite Build too when running npm run build that executes tsc && vite build.

Interestingly I cannot reproduce the same when using yarn as yarn build works just fine.

@wizzymotion
Copy link

Facing same issue on VITE BUILD here...

@nhayfield
Copy link

same here

@pulkitvyas08
Copy link

Facing this issue on Vite Build too when running npm run build that executes tsc && vite build.

Interestingly I cannot reproduce the same when using yarn as yarn build works just fine.

UPDATE: yarn build works on my local windows system but when deploying it gives the above mentioned error

@Anubiso
Copy link

Anubiso commented Mar 4, 2022

Any workarounds known?

@nhayfield
Copy link

Any workarounds known?

not sure. i can say that the previous version also has it 5.4.3

@Anubiso
Copy link

Anubiso commented Mar 4, 2022

found a workaround and added

"resolutions": {
    "csstype": "3.0.10"
  }

to the package.json, now it builds again

@nhayfield
Copy link

found a workaround and added

"resolutions": {
    "csstype": "3.0.10"
  }

to the package.json, now it builds again

Confirmed, good looking out.

@salarhfz-fs
Copy link

Same here.

@mui/base/SliderUnstyled/useSlider.d.ts:146:54
error TS2694:
Namespace 'project_dir/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

146: colorAdjust?: import("csstype").Property.ColorAdjust | undefined;

Environment:
OS: macOS
Package manager: npm@8.3.1
Runtime: Node@16.14.0
Package versions:

"@mui/lab": "^5.0.0-alpha.70",
"@mui/material": "^5.4.3",
"@mui/styled-engine-sc": "^5.4.2",
"@mui/styles": "^5.4.2",

@dezoito
Copy link

dezoito commented Mar 5, 2022

Same thing here, with different dockerized versisn of node:

node:14.15-alpine3.10
node:17.5-alpine3.14 + npm@8.4.1

Packages:

    "@mui/icons-material": "^5.0.0",
    "@mui/lab": "^5.0.0-alpha.47",
    "@mui/material": "^5.0.0",
    "@mui/styles": "^5.0.0",

Using vite, I'm getting the following Typescript errors:

[TypeScript] Namespace '"/app/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

[/app/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:146:54]()

    144 |             clipPath?: import("csstype").Property.ClipPath | undefined;
    145 |             color?: import("csstype").Property.Color | undefined;
  > 146 |             colorAdjust?: import("csstype").Property.ColorAdjust | undefined;
        |                                                      ^^^^^^^^^^^
    147 |             colorScheme?: import("csstype").Property.ColorScheme | undefined;
    148 |             columnCount?: import("csstype").Property.ColumnCount | undefined;
    149 |             columnFill?: import("csstype").Property.ColumnFill | undefined;

[TypeScript] Namespace '"/app/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

[/app/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:651:65]()

    649 |             WebkitPerspective?: import("csstype").Property.Perspective<string | number> | undefined;
    650 |             WebkitPerspectiveOrigin?: import("csstype").Property.PerspectiveOrigin<string | number> | undefined;
  > 651 |             WebkitPrintColorAdjust?: import("csstype").Property.ColorAdjust | undefined;
        |                                                                 ^^^^^^^^^^^
    652 |             WebkitRubyPosition?: import("csstype").Property.RubyPosition | undefined;
    653 |             WebkitScrollSnapType?: import("csstype").Property.ScrollSnapType | undefined;
    654 |             WebkitShapeMargin?: import("csstype").Property.ShapeMargin<string | number> | undefined;

Adding @Anubiso workaround didn't solve the issue, at least not in development.

@dezoito
Copy link

dezoito commented Mar 5, 2022

Those using npm instead of yarn may want to try this instead:

  "overrides": {
    "csstype": "3.0.10"
  }

Unfortunately for me, this breaks other dependencies.

@victor-grajski
Copy link

victor-grajski commented Mar 7, 2022

found a workaround and added

"resolutions": {
    "csstype": "3.0.10"
  }

to the package.json, now it builds again

This works for me with @mui/base, but I'm still seeing this issue with @mui/x-data-grid. Anyone else experiencing that?

ERR! ERROR in /home/runner/work/node_modules/@mui/x-data-grid/hooks/features/virtualization/useGridVirtualScroller.d.ts(625,65):

ERR! TS2694: Namespace '"/home/runner/work/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

@nhayfield
Copy link

ata-grid. Anyone else experiencing that?

ugh i need that repo for the other repo i need to migrate

@caesaneer
Copy link

Same issue here with Vite. I tried the resolutions above, but that made things worse and added 7 more has no exported member errors.

@victor-grajski
Copy link

victor-grajski commented Mar 7, 2022

I think I'm seeing those as well

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:72:60 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'AnimationTimeline'.

72             animationTimeline?: import("csstype").Property.AnimationTimeline | undefined;
                                                              ~~~~~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:147:54 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'PrintColorAdjust'.

147             colorAdjust?: import("csstype").Property.PrintColorAdjust | undefined;
                                                         ~~~~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:205:61 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'HyphenateCharacter'.

205             hyphenateCharacter?: import("csstype").Property.HyphenateCharacter | undefined;
                                                                ~~~~~~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:212:56 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'InputSecurity'.

212             inputSecurity?: import("csstype").Property.InputSecurity | undefined;
                                                           ~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:317:59 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'PrintColorAdjust'.

317             printColorAdjust?: import("csstype").Property.PrintColorAdjust | undefined;
                                                              ~~~~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:625:67 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'HyphenateCharacter'.

625             WebkitHyphenateCharacter?: import("csstype").Property.HyphenateCharacter | undefined;
                                                                      ~~~~~~~~~~~~~~~~~~

node_modules/@mui/material/node_modules/@mui/base/SliderUnstyled/useSlider.d.ts:657:65 - error TS2694: Namespace '"node_modules/@types/react/node_modules/csstype/index".Property' has no exported member 'PrintColorAdjust'.

657             WebkitPrintColorAdjust?: import("csstype").Property.PrintColorAdjust | undefined;

MUI versions:

        "@emotion/react": "^11.8.1",
        "@emotion/serialize": "^1.0.2",
        "@emotion/styled": "^11.8.1",
        "@mui/icons-material": "^5.4.1",
        "@mui/lab": "^5.0.0-alpha.68",
        "@mui/material": "^5.5.0",
        "@mui/system": "^5.4.4",
        "@mui/x-data-grid": "^5.6.0",
        "@mui/x-data-grid-generator": "^5.5.1",
        "@mui/x-data-grid-pro": "^5.5.1",

@salarhfz-fs
Copy link

I just used skipLibCheck in the TS compiler settings (tsconfig.json) for now. BTW we're waiting for a real patch.

@Jonri2
Copy link

Jonri2 commented Mar 8, 2022

After updating my packages to the latest versions, the problem was resolved.

@kohaiy
Copy link

kohaiy commented Mar 8, 2022

found a workaround and added

"resolutions": {
    "csstype": "3.0.10"
  }

to the package.json, now it builds again

added

"resolutions": {
    "csstype": "3.0.11"
 }

to the package.json and remove yarn.lock
and yarn install, the problem was resolved.

@c3-william-peng
Copy link
Author

Yup, after upgrading @mui/material and @mui/icons-material to ^5.5.0 the issues were resolved. Closing this issue as the upgraded versions have resolved this.

@victor-grajski
Copy link

victor-grajski commented Mar 8, 2022

I'm still having this issue with @mui/x-data-grid, although skipping lib check is a stopgap solution. Shall I open a separate issue?

node_modules/@mui/x-data-grid/hooks/features/virtualization/useGridVirtualScroller.d.ts:117:54 - error TS2694: Namespace '"node_modules/@mui/material/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

117             colorAdjust?: import("csstype").Property.ColorAdjust | undefined;
                                                         ~~~~~~~~~~~

node_modules/@mui/x-data-grid/hooks/features/virtualization/useGridVirtualScroller.d.ts:625:65 - error TS2694: Namespace '"node_modules/@mui/material/node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.

625             WebkitPrintColorAdjust?: import("csstype").Property.ColorAdjust | undefined;

My MUI versions:

"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.5.0",
"@mui/lab": "^5.0.0-alpha.68",
"@mui/material": "^5.5.0",
"@mui/x-data-grid": "^5.6.0",
"@mui/x-data-grid-generator": "^5.5.1",
"@mui/x-data-grid-pro": "^5.6.0",

Resolutions:

"resolutions": {
    "csstype": "^3.0.11"
}

@c3-william-peng
Copy link
Author

@victor-grajski Seems like @mui/x-data-grid hasn't updated their libraries, probably should open an issue with them here: https://github.com/mui/mui-x

@GDC94
Copy link

GDC94 commented Mar 31, 2022

Despu茅s de actualizar mis paquetes a las 煤ltimas versiones, se resolvi贸 el problema.

hello friend, what command did you use?

@jedwards1211
Copy link
Contributor

@c3-william-peng it still happens with the latest @mui/styles as far as I can see

@bradleat
Copy link

It looks like @mui/base v5.0.0-alpha.80 isn't including csstype as a dependency, which is breaking the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work package: base-ui Specific to @mui/base typescript
Projects
None yet
Development

No branches or pull requests