akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.73k stars 2.1k forks source link

Doesn't work in Next.js 14 (production mode) #2336

Open humanua opened 8 months ago

humanua commented 8 months ago

In version 0.30.1 in development mode in Next.js 14 it works well, but when I build my application (production mode) the slider doesn't work. but everything works fine in version 0.29.0

Davron129 commented 7 months ago

Same issue, I got this error after build command:

Type error: 'Slider' cannot be used as a JSX component. Its type 'typeof Slider' is not a valid JSX element type.

shipmaal commented 7 months ago

Works fine for me with Next.js 14.1.0 and react-slick 0.30.2

20manas commented 7 months ago

I was having the same issue. In my case, what the fixed the issue was removing @types/react-slick

refex commented 6 months ago

same here, next14

daibergm commented 5 months ago

Same issue, I'm using next V14.1.4: image

GeorgeArubi commented 4 months ago

I was having the same issue. In my case, what the fixed the issue was removing @types/react-slick

So how did you use the Slider without type definitions? I'm assuming you're using typescript right?

20manas commented 4 months ago

I was having the same issue. In my case, what the fixed the issue was removing @types/react-slick

So how did you use the Slider without type definitions? I'm assuming you're using typescript right?

Yes I am using typescript. The types aren't available, but what is accepted by the components is in the docs, so I used that.

linucks commented 3 months ago

Same issue here. Removing the type declartion doesn't help ("react-slick": "^0.30.2", "next": "^14.2.3")

songxiaoliang commented 3 months ago

Same issue here. Removing the type declartion doesn't help ("react-slick": "^0.30.2", "next": "^14.2.3")

Sergiy5 commented 3 months ago

Help to me instal npm i --save-dev @types/react-slick

aliffazfar commented 2 months ago

You can fix by using this specific version in your package.json: "@types/react": "18.2.21", "@types/react-dom": "18.2.7"

ReactDev81 commented 1 month ago

I am using the following versions: "next": "14.2.6", "react": "^18", "react-slick": "^0.29.0", and "slick-carousel": "^1.8.1". I am encountering an issue.

image

So just using 'use client' at the top of the component and the issue is resolved