Skip to content

Regression in 0.38: introduces import-time call to document.createElement which fails in non-browsers #2174

@ianmacartney

Description

@ianmacartney

Describe the bug

Ever since 0.38.0, there is a dependency on decode-named-character-reference at import time for BlockNoteEditor, such that importing it causes Uncaught ReferenceError: document is not defined in environments where document doesn't exist, e.g. Convex functions. I also filed #2173 to track the broader ask of supporting serverless environments.

To Reproduce

get-convex/prosemirror-sync#187
clone the repo, then npm i && npm run dev - it should successfully deploy to Convex. After upgrading to 0.38, it fails.

Misc

  • Node version:v20.19.5
  • Package manager:npm
  • Browser:non-browser environment (Convex.dev)
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect or unexpected behavior in existing functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions