NEXT JS SSR
Unanswered
Australian Shepherd posted this in #help-forum
Australian ShepherdOP
Hi everyone, I’m embedding my Next.js standalone build into a Rust executable using rust-embed.
Everything works fine except that when I run the extracted server (node server.js), I get this error:
Error: Cannot find module 'react-router-dom'
It seems that the react-router-dom routes module isn’t included inside the .next/standalone build, even though it works normally when I run it from my project folder.
Does anyone know how to make Next.js include react-router-dom (and similar client-side dependencies) in the standalone build? Or should I manually copy the module into the standalone folder before embedding?
Everything works fine except that when I run the extracted server (node server.js), I get this error:
Error: Cannot find module 'react-router-dom'
It seems that the react-router-dom routes module isn’t included inside the .next/standalone build, even though it works normally when I run it from my project folder.
Does anyone know how to make Next.js include react-router-dom (and similar client-side dependencies) in the standalone build? Or should I manually copy the module into the standalone folder before embedding?