NotionX / NotionX/react-notion-x
require() issue on Next.js 13
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 645
- PR merge metrics
- No merged PRs in 30d
Description
Description
Trying to render Notion pages in Next.js 13, running into this error:

Here's the code:
import { NotionAPI } from 'notion-client';
import { use } from 'react';
import { NotionRenderer } from 'react-notion-x';
const notion = new NotionAPI();
async function getNotionPage(id: string) {
let recordMap = await notion.getPage(id);
return recordMap;
}
export default function Page({ params }: { params: { id: string } }) {
let recordMap = use(getNotionPage(params.id));
console.log({ recordMap });
return (
<NotionRenderer
recordMap={recordMap}
fullPage={true}
darkMode={false}
/>
);
}
Here's the directory tree:

Notion Test Page ID
https://www.notion.so/witholdfriends/jm-sv-0bf617f4fbaf40ecbd58f7bceb29cfff
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Page component and reproduce the require() error in a Next.js 13 app using the shown notion-client, react, and react-notion-x imports. Trace which dependency or rendering boundary triggers the error; done means the Notion test page renders without the reported error, with a regression check if the repository provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100