ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
27.55k stars 2.29k forks source link

[Bug]: Server generateHTML causes "attempted to call map" error using next #5779

Closed churbis closed 2 weeks ago

churbis commented 2 weeks ago

Affected Packages

@tiptap/html

Version(s)

2.9.1

Bug Description

Next route using import { generateHTML } from "@tiptap/html" throws an Unhandled Runtime Error: Error: Attempted to call map() from the server but map is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component. despite being advertised as SSR ready in the docs

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Renders HTML server side w/o error

Additional Context (Optional)

No response

Dependency Updates

nperez0111 commented 2 weeks ago

@tiptap/html definitely does work on the server, many are using it.

It looks like you did not invoke your function correctly. Next.js is out of scope of this project. You likely need to specify 'use server' for whatever this map function is.