Search code examples
next.js13react-three-fiber

useLoader() throws TypeError: Failed to parse URL from /lut/F-6800-STD.cube


I was recreating the setup for the prism sample https://codesandbox.io/p/sandbox/nextjs-prism-j3ycvl using Next.js, and it turns out that the framework is having a hard time to parsing the .cube file

export default function App() { 
const texture = useLoader( LUTCubeLoader, "/lut/F-6800-STD.cube" ); 
return ...
}

public folder

Any solution for this matter? I recreated the sample using vite framework and everything works fine there.


Solution

  • disabling the ssr fixed the issue https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-no-ssr

    Shut out to Cody dev from the r3f team!