splitbee / react-notion

A fast React renderer for Notion pages
https://react-notion.com
MIT License
2.87k stars 155 forks source link

Example not compiling #41

Closed yashagarwal10 closed 3 years ago

yashagarwal10 commented 3 years ago

I'm not able to compile the example given in the repo, the following is the output

[ec2-user@ip-172-31-5-195 example]$ npm run build

> react-notion-example@1.0.0 build /home/ec2-user/react-notion/example
> next build

Failed to compile.

./pages/[pageId].tsx:47:9
Type error: Type '{ blockMap: any; fullPage: true; customBlockComponents: { page: ({ blockValue, renderComponent }: { blockValue: any; renderComponent: any; }) => Element; }; }' is not assignable to type 'IntrinsicAttributes & NotionRendererProps & { children?: ReactNode; }'.
  Property 'customBlockComponents' does not exist on type 'IntrinsicAttributes & NotionRendererProps & { children?: ReactNode; }'.

  45 |         blockMap={blockMap}
  46 |         fullPage
> 47 |         customBlockComponents={{
     |         ^
  48 |           page: ({ blockValue, renderComponent }) => (
  49 |             <Link href={`/${blockValue.id}`}>{renderComponent()}</Link>
  50 |           )
info  - Creating an optimized production build .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-notion-example@1.0.0 build: `next build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-notion-example@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ec2-user/.npm/_logs/2020-12-09T06_24_12_204Z-debug.log
wasita commented 3 years ago

Did you ever figure this out? I'm getting the same error.

wasita commented 3 years ago

I did 'npm run dev' instead of 'npm run build' and that seems to get the example going. I guess it just wasn't clear in the readme that you had to start the development server instead of building

tobiaslins commented 3 years ago

This should be fixed already. Let me know if it appears again!