Minified React error #130 with react-slick in Sage 10

Hi,

I’m using react-slick package for creating sliders in react component. I have simply installed the react-slick as a package dependency using the below command:

yarn add react-slick

Then Added it to the react component like this:

import Slider from 'react-slick';

Now, Whenever I make build using command yarn build. Build gets completed without any error, but if I check this on the browser there is some console errors there:

Error: Minified React error #130; 
visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= 
for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

I checked with the mentioned URL as well it says Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. I closely looked into this and confirmed that in my component code is not violating this rule.

Can anyone faced that issue? Is there any workaround into this? Or is there any way to find the exact line of code causing this issue?

Using Sage 10 with react@18.0.2 and react-slick@^0.29.0

Thanks!

It can be something as subtle as this (defining a component directly instead by a function that returns it): Debugging “element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object” in React | by bits-simplified | Medium.