Sanity error when trying to run vercel build: sanity/..page.jsx doesn’t have a root layout. To fix this error, make sure every page has a root layout

Running my project locally works totally fine but it does not when I am try to deploy it to vercel.

It says тип sanity/[[…index]]/page.jsx doesn’t have a root layout. To fix this error, make sure every page has a root layout.
Compiler server unexpectedly exited with code: 1 and signal: null

I tried googling but found no solutions so I deleted the files by sending it to the trash bin but when I do that it is unable to fetch the data from the Sanity back-end. I don’t know what to do. Here is my code for the page.jsx:

'use client'

import { NextStudio } from 'next-sanity/studio'
import config from '../../../../sanity.config'

export default function StudioPage() {
  return <NextStudio config={config} />
}