Skip to content

Conversation

@7908837174
Copy link

@7908837174 7908837174 commented Oct 22, 2025

This PR implements user-friendly error handling for unsupported block types in react-notion, addressing Issue #87.

Problem Solved

Previously, when unsupported content types (databases, checkboxes, table of contents) were encountered, the library would silently fail to render content, leaving users confused.

Solution Implemented

  • UnsupportedBlockError Component: Displays clear, actionable error messages
  • Enhanced NotionRenderer Props: Added showUnsupportedBlockErrors (default: true) and onUnsupportedBlock callback
  • Professional Styling: Clean, accessible design with dark mode support
  • Backward Compatibility: No breaking changes, can be disabled if needed

Files Changed

  • Added src/components/unsupported-block-error.tsx
  • Enhanced src/block.tsx with error handling in default case
  • Updated src/renderer.tsx with new props
  • Added CSS styling in src/styles.css
  • Includes demo component showing functionality

Fixes #87

- Implements solution for issue splitbee#87: Return errors when importing unsupported content types
- Adds UnsupportedBlockError component with clear, actionable error messages
- Supports databases, checkboxes, table of contents, and other unsupported blocks
- Provides helpful suggestions (remove block or use react-notion-x)
- Maintains backward compatibility with showUnsupportedBlockErrors prop (default: true)
- Includes optional onUnsupportedBlock callback for custom error handling
- Adds comprehensive CSS styling with dark mode support
- Replaces silent failures with user-friendly error messages

Breaking change: None - error display is enabled by default but can be disabled
Fixes: splitbee#87
@7908837174
Copy link
Author

Hi sir @cball , @plc , @dvdsgl , @vczb , @thmsmlr , @transitive-bullshit , Requesting review for PR #128 (Fixes #87)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return errors when importing unsupported content types

1 participant