Open saurabhburadkar opened 1 year ago
I have the same error - trying to use this in a nextJS environment
node_modules/react-three-mind/dist/index.js (1:3305148) @ eval
⨯ Error: Automatic publicPath is not supported in this browser
at __webpack_require__ (/Users/alistairmcclymont/Sites/amcc-work/jack warne/jack-ar-next/.next/server/webpack-runtime.js:33:43)
at eval (./app/page.js:10:74)
at (ssr)/./app/page.js (/Users/alistairmcclymont/Sites/amcc-work/jack warne/jack-ar-next/.next/server/app/page.js:217:1)
at __webpack_require__ (/Users/alistairmcclymont/Sites/amcc-work/jack warne/jack-ar-next/.next/server/webpack-runtime.js:33:43)
at JSON.parse (<anonymous>)
null
I faced this error with nextjs too, it seems to have to do with SSR I resolved it by using dynamic imports, replaced:
import { ARAnchor, ARView } from "react-three-mind";
with: 'use client' import dynamic from 'next/dynamic'; const ARView = dynamic(() => import('react-three-mind').then((mod) => mod.ARView), { ssr: false }); const ARAnchor = dynamic(() => import('react-three-mind').then((mod) => mod.ARAnchor), { ssr: false });
I meant to post that I solved this in exactly the same way. The error isn't next specific, I tried this in Gatsby and also got this error. It stems from node on the server testing to access browser only studio I believe.
For any Gatsby (or other compiled frameworks) use loadable component to achieve the same thing as the above answer