Nesting document types and using Sanity with Next.js discussed in Slack thread
srcfolder?
/adminbut you can use
/studiotheres other ways to do it but I found this to work very easy
useContexterror when running
next devcommand. I checked for possible problems, like version mismatch. Versions are OK. In the demo next.js pages folder, there are no componenets which explicitly use hooks, so I guess that's not the problem either. Lastly, maybe the problem is that there are two
reactand
react-domlibraries one for next.js and one for the sanity studio. But these two shouldn't interfere wiht one another. So, what do you suggest? How could I solve this?
Take a look at the
package.jsonscripts and in the
next.config.jsis where the routing get handled to use the studio on domain .com/admin
https://www.sanity.io/guides/sanity-nextjs-tailwindcss
sanity startand then runs build commands for next
npm create nextjs@latestthen inside the admin folder I installed sanity separately. It's fine, both work seamlessly, but Nextjs is bugging me. Anyway, thank you for replying. Have a good one. 🙂
Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.