viclafouch / mui-color-input

📌 A color input designed for MUI (Material ui) V6 built with TinyColor
https://viclafouch.github.io/mui-color-input/
60 stars 20 forks source link

2.0.1 doesn't work on NextJS 14.0.4 #28

Closed pcreehan closed 8 months ago

pcreehan commented 8 months ago
Describe the bug When using mui-color-input on a production built web application using NextJs 14.0.4, the color preview thumbnail is always the default checker and the color set is always #000000. NextJS Version MUI-Color-Input version Works?
14.0.3 2.0.0
14.0.3 2.0.1
14.0.4 2.0.0
14.0.4 2.0.1

dev builds work (next dev), but production builds (next build && next start) do not.

To Reproduce Steps to reproduce the behavior: CodeSandbox repro

  1. Open the sandbox above
  2. Interact with the mui-color-input control on the page.
  3. Note that choosing a color doesn't close the selector and clicking away sets the color to #000000

Expected behavior Clicking the color selector should fire the onChange event with the new color selected.

Screenshots

image image

Desktop (please complete the following information):

Additional context

viclafouch commented 8 months ago

Hello !

Can you try installing the other required packages plz ?

npm i @emotion/react @emotion/styled @mui/material

Ty

fatgy commented 8 months ago

I had this issue and temporary fix by use "@ctrl/tinycolor": "^3.0.0".

Look like bug "@ctrl/tinycolor": "^4.0.2" compute wrong value.

viclafouch commented 8 months ago

Hummm I fixed just by installing the missing packages :)

https://codesandbox.io/p/devbox/mui-color-repro-forked-rhz5vq