Skip to content

[BUG] Clicking page in trash crashes preview #2552

Closed

Description

@khueue

Description

In v0.96.0, clicking a page in a space's Trash to preview it crashes the preview with:

    Uncaught TypeError: can't access property "dispatchTransaction", t is undefined
        createView / mount            (api-client-*.js)
        createEditor / getInitialEditor (mention-view-*.js)
        ...
        onClick                        (space-trash-*.js)

The preview never renders. Restoring from the trash still works.

Steps to reproduce

  1. Self-hosted Docmost v0.96.0 (Docker image docmost/docmost:0.96.0), community edition.
  2. Move a page to the trash.
  3. Open the trash and click the page to preview it.

Cause

apps/client/src/features/editor/readonly-page-editor.tsx passes editorProps only for public views and explicitly undefined otherwise:

https://github.com/docmost/docmost/blob/v0.96.0/apps/client/src/features/editor/readonly-page-editor.tsx#L135-L147

The explicit undefined overrides Tiptap's default editorProps: {}. Editor.createView() in @tiptap/core 3.31.3 then reads editorProps.dispatchTransaction and throws:

https://github.com/ueberdosis/tiptap/blob/v3.31.3/packages/core/src/Editor.ts#L582-L587

Public shares and public spaces are unaffected because isPublicView is true there. The non-public callers are the trash preview (trash-page-content-modal.tsx) and the EE PDF render page (pdf-render-page.tsx).

This was introduced in #2420 (lightbox), which added editorProps={… : undefined}; v0.95.0 passes no editorProps and is not affected.

Suggested fix

--- a/apps/client/src/features/editor/readonly-page-editor.tsx
+++ b/apps/client/src/features/editor/readonly-page-editor.tsx
@@ -143,7 +143,7 @@
                   setLightboxRequest(request);
                   return true;
                 },
               }
-            : undefined
+            : {}
         }
         onCreate={({ editor }) => {

Activity

  1. changed the title [-]Clicking page in trash crashes preview[/-] [+][BUG] Clicking page in trash crashes preview[/+] on Oct 9, 2026
  2. Philipinho commented on Oct 9, 2026

    @Philipinho
    Member

    Thanks for flagging. Will get this fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions