fix(core): exclude unused @tiptap collab deps from optimizeDeps#780
Open
mvanhorn wants to merge 5 commits intoemdash-cms:mainfrom
Open
fix(core): exclude unused @tiptap collab deps from optimizeDeps#780mvanhorn wants to merge 5 commits intoemdash-cms:mainfrom
mvanhorn wants to merge 5 commits intoemdash-cms:mainfrom
Conversation
Vite's esbuild scanner follows a non-static import() inside @tiptap/react or @tiptap/starter-kit that references @tiptap/extension-collaboration and @tiptap/y-tiptap. Neither package is imported by source code in this repo and neither is declared in packages/admin/package.json or the pnpm-workspace catalog, so a fresh install fails dependency optimization with "Could not resolve @tiptap/y-tiptap" before the dev server is reachable. Append both packages to optimizeDeps.exclude in both the Cloudflare and non-Cloudflare branches of the Astro integration's vite-config.ts so esbuild skips resolving them. The repo continues to work correctly with the @tiptap/* packages it actually uses. Fixes emdash-cms#771
🦋 Changeset detectedLatest commit: f691973 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
…xclusion Calls createViteConfig with both Cloudflare and Node mock adapters and asserts that the resulting optimizeDeps.exclude (and ssr.optimizeDeps .exclude on the Cloudflare path) carries @tiptap/extension-collaboration and @tiptap/y-tiptap. Verified to fail without the fix and pass with it. Also picks up oxfmt's reformatting of the inline exclude array on the SSR branch (one-liner instead of multi-line list) — purely cosmetic. Refs emdash-cms#771
ascorbic
reviewed
Apr 27, 2026
Collaborator
ascorbic
left a comment
There was a problem hiding this comment.
Thanks! Just one small note
Comment on lines
+400
to
+403
| "virtual:emdash", | ||
| "@tiptap/extension-collaboration", | ||
| "@tiptap/y-tiptap", | ||
| ] |
Collaborator
There was a problem hiding this comment.
Instead of repeating the array, could you define it as a constant used in both places?
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.
What does this PR do?
A fresh
npm create emdash@latestfollowed byyarn devfails during dependency optimization on@tiptap/extension-collaborationand@tiptap/y-tiptap(#771):Neither package is imported by any source file in this repo (verified by grep across
packages/admin/src,packages/core/src, etc.), and neither is declared inpackages/admin/package.jsonor in the catalog insidepnpm-workspace.yaml. They show up in the pnpm store as transitive installs only.What's happening: Vite's esbuild dependency scanner follows a non-static
import()somewhere inside@tiptap/reactor@tiptap/starter-kitthat references these two collaboration packages, and the scan fails because they're not installed. The dev server never finishes booting on a clean checkout.This PR appends both packages to the
optimizeDeps.excludearray in both the Cloudflare and non-Cloudflare branches of the Astro integration'svite-config.ts, so esbuild skips resolving them entirely. The repo continues to work fine with the 17@tiptap/*packages it actually uses.Closes #771
Type of change
Checklist
pnpm typecheckpasses — N/A locally; the change is a string-array literal addition with no type changes.pnpm lintpasses (pnpm --silent lint:jsonreported zero diagnostics)pnpm testpasses (or targeted tests for my change) — N/A; no test exercises optimizeDeps shape directly. End-to-end verification isnpm create emdash@latest && yarn devsucceeds.pnpm formathas been run.changeset/rude-seas-guess.md,emdashpatch)AI-generated code disclosure
Developed with Claude Code orchestrating Codex CLI (gpt-5.5 high). The change is a 2-element addition to two existing
optimizeDeps.excludearrays plus a one-line comment above each.Screenshots / test output
To verify end-to-end on a maintainer's machine:
npm create emdash@latest(orpnpm create emdash@latest)cd <project> && yarn devCould not resolve "@tiptap/extension-collaboration".