最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - NextJs Dynamic Import Spline - Stack Overflow

programmeradmin2浏览0评论

I have Dynamic imported Spline like this in the Nextjs project

const DynamicSpline = dynamic(() => import('@splinetool/react-spline'), {
  ssr: false,
  loading: () => (
    <div className="w-full h-full flex items-center justify-center bg-black opacity-50">
    </div>
  ),
});

and calling it like this

<DynamicSpline
  scene={splineFilePath}
  onLoad={() => {
  setIsSplineLoaded(true);
  }}
/>

While running the code I get this issue

./src/components/Home/HeroSection.tsx Module not found: Package path . is not exported from package C:\Users\karan\OneDrive\Desktop\solvejet\node_modules@splinetool\react-spline (see exports field in C:\Users\karan\OneDrive\Desktop\solvejet\node_modules@splinetool\react-spline\package.json)

Not sure what's the issue

发布评论

评论列表(0)

  1. 暂无评论