I'm trying to use this react-carousel-3d library https://github.com/suhailsulu/react-carousel-3d but I'm getting the below error as the library is not developed to support SSR.
`ReferenceError: window is not defined`
at Object.<anonymous> (C:\Deba\Workspace2021\Nextjs\myportfolio\node_modules\3d-react-carousal\dist\index.js:1:255)
Now I'm trying to use dynamic imports with no SSR https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr
const {Carousel} = dynamic(
() => import('../node_modules/3d-react-carousal/src/index.js'),
{ ssr: false }
)
I'm getting below error now:
./node_modules/3d-react-carousal/src/index.js 189:12
Module parse failed: Unexpected token (189:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
render() {
return (
<div className="react-3d-carousel" style={{ height: this.state.height }}>
{this.state.slides && this.state.slides.length > 0 &&
<div className="slider-container">
Can somebody point out what i'm doing wrong here or any ideas on how to get this working?