Next.js Discord

Discord Forum

pages won't render without an empty getServerSideProps

Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I have a sanity studio embedded in my next js app at pages/studio/[[...index]].tsx like so:
import Head from "next/head";
import { NextStudio } from "next-sanity/studio";
import { NextStudioHead } from "next-sanity/studio/head";
import { StudioLayout, StudioProvider } from "sanity";
import config from "../../../sanity.config";
import { createGlobalStyle } from "styled-components";

const GlobalStyle = createGlobalStyle(({ theme }) => ({
    html: { backgroundColor: },

export default function StudioPage() {
    return (
                <NextStudioHead favicons={false} />

            <NextStudio config={config}>
                <StudioProvider config={config}>
                    <GlobalStyle />
                    <StudioLayout />

export async function getServerSideProps() {
    return {
        props: {},

With the code above the page renders as expected, but when I remove the getServerSideProps, nothing renders, there are no errors that appear anywhere, what could be causing this?

0 Replies