Heading block tries to insert a paragraph on Enter, even when the paragraph block is unregistered, resulting in an error
Describe the bug
You cannot press enter to add a new block in the editor when the default paragraph block is unregistered using unregisterBlockType. Console error thrown is react-dom.min.js?ver=16.9.0:15 Uncaught TypeError: Cannot read property 'attributes' of undefined
To reproduce Steps to reproduce the behavior:
- Disable your paragraph block using a blacklist or whitelist
- Go into the editor of a page or post.
- Add a block other than paragraph. e.g. Heading. Press enter after editing its content.
- Open console and see error. Try pressing enter again to see it throw the error again.
Expected behavior
Ideally when one presses enter in the editor and paragraph is disabled, you should still be able to type in the keyboard shortcut for the new block you want. e.g. /image.
Screenshots

Editor version (please complete the following information):
- WordPress version: 5.4
- Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Gutenberg plugin
- If the Gutenberg plugin is installed, which version is it? 7.9.1
Desktop (please complete the following information):
- OS: MacOS Mojave Version 10.14.6
- Browser: Chrome
- Version 81.0.4044.113
@jessynd To register a different block as the default block you can use the setDefaultBlockName function, which is how paragraph becomes the default block:
https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/index.js#L159
This worked ok for me, I could set the heading to the default block and insert other blocks using the slash command when in a heading block.
The issue in your screen capture seems to be related to the heading block attempting to create a paragraph on enter:
https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/edit.js#L78
You can see it's hard-coded to core/paragraph. Maybe if that also referenced the default block name another heading could be inserted instead.
If you don't mind I'll re-title the issue to reference that this is a bug with the heading block.