Skip to content

generateJSON imported from @tiptap/html/server does not work on the server #6939

@Kasheftin

Description

@Kasheftin

Affected Packages

@tiptap/html

Version(s)

3.4.2

Bug Description

I'm trying to generate JSON from HTML on the server following the docs: https://tiptap.dev/docs/editor/api/utilities/html
It says:

/* ON SERVER OR BROWSER - See above for browser only compatible package (ships less JS) */
import { generateHTML } from '@tiptap/html'

So, I installed @tiptap/html package using pnpm i --save @tiptap/html and I'm trying to use it in my Nest.js application. However, it says

generateJSON can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.

I'm reporting this as an issue. Well, at least the issue is about the documentation (the very first screen, the first example).

Browser Used

Other

Code Example URL

No response

Expected Behavior

The docs should be fixed. The package @tiptap/html should be available for server-side usage.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageA new issue or pullrequest that requires triage (added by default)Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.

    Type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions