fix(xl-ai): remove 'use client' from server entry#2860
Open
YousefED wants to merge 1 commit into
Open
Conversation
The "@blocknote/xl-ai/server" entry carried a "use client" directive, which the build copied into dist/server.js. Frameworks like Next.js then treated the whole server bundle as client-only, breaking server usage of exports such as injectDocumentStateMessages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
@blocknote/xl-ai/serverentry was marked with a"use client"directive, which broke server-side usage.Rationale
packages/xl-ai/src/server.tsis the dedicated build entry for@blocknote/xl-ai/server. The"use client"directive at the top of the file was copied verbatim into the builtdist/server.jsanddist/server.cjs. As a result, frameworks like Next.js treated the entire server bundle as client-only, causing errors such as:The directive was misplaced — the server entry is meant for server use only, and its exports are server-safe.
Changes
"use client";directive frompackages/xl-ai/src/server.ts.Impact
Server-side consumers (Next.js API routes, Node.js backends) can now import from
@blocknote/xl-ai/serverand use exports likeinjectDocumentStateMessageswithout errors.Verified the rebuilt
dist/server.js/dist/server.cjsno longer contain"use client", and that no client-only deps (e.g.@ai-sdk/react) are pulled into the server bundle — the type-only imports are erased at build time.Testing
"use client"is gone from the server bundle and all exports remain intact.Checklist
Closes #2841
🤖 Generated with Claude Code