fix(plugin-embeds): import embed components directly to avoid astro-auto-import in workerd#1840
Conversation
🦋 Changeset detectedLatest commit: 3e01424 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@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-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
|
This PR has been inactive for 14 days. It will be closed automatically in 7 days if there is no further activity. If you're still working on this, please push an update or leave a comment. |
…uto-import in workerd (emdash-cms#938) astro-embed's umbrella entrypoint pulls in @astro-community/astro-embed-integration, which depends on astro-auto-import (no Astro 6/7 support). Astro's Cloudflare dev runner evaluates modules one at a time inside workerd (no exports/module globals), so the CJS leakage anywhere in that chain crashes every route with "exports is not defined" -- even though the plugin never uses the integration, only individual embed components. Each component also ships standalone as its own @astro-community/astro-embed-* package with none of that baggage, so importing directly from the sub-package sidesteps the crash entirely. Co-Authored-By: Claude Opus 4.8 ultracode <noreply@anthropic.com>
0e8c4c2 to
9475fdf
Compare
…itest explicitly pnpm-lock.yaml was left outdated after the rebase, failing CI's frozen-lockfile check. Regenerating via workspace-wide vitest:catalog hits an unrelated pre-existing break in packages/core/package.json (@vitest/ui ^4.1.10 -> @vitest/pretty-format@4.1.10 not yet published upstream) -- pinning this package's vitest devDependency explicitly sidesteps that catalog-wide resolution. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Prior lockfile regen was reset against the fork's stale main (281 commits behind emdash-cms/emdash), producing a lockfile that wouldn't match the PR's real merge base. Regenerated against upstream/main instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Branch was 11 commits behind; pulling in main to keep the regenerated lockfile aligned with what CI currently resolves cleanly elsewhere (main's Query Counts run passes; this branch's did not).
…rd crash astro-community/astro-embed-bluesky depends on @atproto/api, whose CommonJS build (transitively multiformats) hits the same require/exports-global crash in Astro's Cloudflare dev runner as the astro-embed umbrella package fixed earlier in this PR (emdash-cms#938). Bluesky posts now render via Bluesky's own oEmbed endpoint (embed.bsky.app) instead, with no @atproto/api dependency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Pushed a follow-up fix in this branch: `@astro-community/astro-embed-bluesky` depends on `@atproto/api` -> `multiformats`, both CommonJS, hitting the same workerd `require`/`exports`-not-defined crash this PR already fixes for the `astro-embed` umbrella package. Bluesky posts now render via Bluesky's own oEmbed endpoint (`embed.bsky.app`) instead, with no `@atproto/api` dependency. The remaining `Measure` (d1 target) and `E2E Cloudflare` failures on this branch are not caused by this PR -- filed separately as #2216. Confirmed via `git diff` that `packages/core`, `packages/cloudflare`, and both fixtures (`fixtures/perf-site`, `e2e/fixture-cloudflare`) are byte-identical to `main`, and neither fixture depends on `plugin-embeds`. Reproduced identically across 3 CI runs, including one after merging latest `main` into this branch. |
|
CI failing 3x in a row now (2026-07-23 06:28, 06:50, and again just now) with the identical signature: Checked for a code correlation and found none: I don't have rerun permissions on this repo ( |
|
CI failure on the latest run (5f9de56) — Smoke Tests, Measure, and all 8 E2E Cloudflare jobs failed the same way: the Postgres service container spins for ~16min logging I don't have rerun permissions on this repo (fork PR) — could someone with admin access re-run the failed jobs? |
Will revert after capturing real crash output; CI currently gives no visibility into why the dev server never boots (silent since DEBUG unset).
…agnosis" This reverts commit 8cb3f54.
…ella package
Keeping Gist, LinkPreview, Mastodon, Tweet, Vimeo, and YouTube on the
astro-embed umbrella package (matching main) instead of switching them
to individual @astro-community/astro-embed-* dependencies. Adding those
as direct workspace dependencies broke the unrelated e2e/fixture-cloudflare
dev server ("require is not defined" in workerd, before any request is
served) via a pnpm/Vite monorepo dependency-resolution interaction unrelated
to plugin-embeds' own code -- confirmed by bisection with fresh, frozen-
lockfile installs matching CI exactly. The Bluesky fix (dropping
astro-embed-bluesky/@atproto/api for a direct oEmbed call) is unaffected
and unchanged, since it never depended on the umbrella package or the
new individual packages either way.
Trimmed no-astro-embed-integration.test.ts to only the Bluesky-specific
assertions, since the other components now intentionally go back through
astro-embed. Dropped the stale-donkeys-jump changeset describing the
now-reverted migration.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
What does this PR do?
astro-embed's umbrella entrypoint pulls in
@astro-community/astro-embed-integration, which depends onastro-auto-import(no Astro 6/7 support). Astro's Cloudflare dev runner evaluates modules one at a time inside workerd (noexports/moduleglobals), so the CJS leakage anywhere in that chain crashes every route with "exports is not defined" — even though the plugin never uses the integration, only individual embed components. Each component also ships standalone as its own@astro-community/astro-embed-*package with none of that baggage, so importing directly from the sub-package sidesteps the crash entirely.Closes #938
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
packages/plugins/embeds— 9/9 tests pass (newtests/no-astro-embed-integration.test.tsasserts the umbrella package is never imported);pnpm lint:quickclean;pnpm typecheckclean.Opened as draft: fork already has several open PRs against this repo (non-collaborator open-PR limit).