Repository: next.js
Issue: Application error: a client-side exception has occurred (see the browser console for more information).
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
I am using latest Vision(s)

Next: 13.4.4 (latest)
NodeJs: 18
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue or a replay of the bug

line to repo: https://github.com/hobbiest/

### To Reproduce

![Screenshot 2023-06-08 114254](https://github.com/vercel/next.js/assets/79841865/0b3b9b6e-39db-4256-8824-b4a62f77d91e)


### Describe the Bug

Application error: a client-side exception has occurred (see the browser console for more information).
IN Console:
framework-2c79e2a64abdb08b.js:9 TypeError: Cannot read properties of undefined (reading 'map')
    at N (919.8fd23e28ee988cd3.js:1:356)
    at ab (framework-2c79e2a64abdb08b.js:9:60915)
    at i (framework-2c79e2a64abdb08b.js:9:119473)
    at oO (framework-2c79e2a64abdb08b.js:9:99112)
    at framework-2c79e2a64abdb08b.js:9:98979
    at oF (framework-2c79e2a64abdb08b.js:9:98986)
    at ox (framework-2c79e2a64abdb08b.js:9:95738)
    at oS (framework-2c79e2a64abdb08b.js:9:94293)
    at x (framework-2c79e2a64abdb08b.js:33:1373)
    at MessagePort.T (framework-2c79e2a64abdb08b.js:33:1903)


I am trying to use getServerSideProps() {} to fetch and return json but its not working while routing to that specific page.

Facing this only in 'npm run build' and in production not locally...

my following Codes:

import css from "@/sass/Notes/Notes.module.scss";
import Navbar from '@/components/shared/Navbar';
import { MainFont, SecondaryFont } from '@/public/utils/fonts';
import {SiJavascript, SiHtml5, SiCss3} from "react-icons/si"
import axios from 'axios';

const icons = [
    SiJavascript,
    SiHtml5,
    SiCss3,
]

export async function getServerSideProps() {
  try {
    const res = await axios.get('https://hobbiestcodes.tech/api/notes');
    const notes = await res.data; // Use res.data instead of res.json()
    console.log(notes);
    return {
      props: {
        notes,
      },
    };
  } catch (error) {
    console.error("Error While Fetching", error);
    return {
      props: {
        notes: [], // Return an empty array if the API request fails
      },
    };
  }
  }

function NoteCards({ notes }) {
  const mainContent = (
    <>
      {notes.length > 0 ? (
        notes.map((items, index) => {
          const Icons = icons[index];
          return (
            <div className={css.box} key={items.id}>
              <p className={css.date}>Published at: {items.UploadedOn}</p>
              <div className={css.allData}>
                <Icons className={css.Icon} style={{ color: items.iconColor }} />
                <h2>{items.langName}</h2>
                <p>{items.langDesc}</p>
                <a href={items.dlLink}>
                  <button>Download Now!</button>
                </a>
              </div>
            </div>
          );
        })
      ) : (
        <p>No notes available.</p>
      )}
    </>
  );

  return <>{mainContent}</>;
}






function Notes({ notes }) {
  return (
    <>
      <main className={css.bg}>
        <div className={`${css.bigContainer} ${MainFont.variable} ${SecondaryFont.variable}`}>
          <Navbar />
          <div className={css.childContainer}>
            <h1>Download HandWritten Notes by Hobbiest Codes</h1>
            <div className={css.boxes}>
              <NoteCards notes={notes} />
            </div>
          </div>
        </div>
      </main>
    </>
  );
}

export default Notes;

Please help me to fix or tell me if i have to change my vision(s) 
I have tried ChatGpt also to find out whats going on he tried but didn't worked...

Please help to fix this error.

### Expected Behavior

Get json as props..

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_