fix: cloudflare ssr deps optimization#16708
Conversation
🦋 Changeset detectedLatest commit: e0be125 The changes in this PR will be included in the next version bump. This PR includes changesets to release 37 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 |
46a71bc to
fdecfb1
Compare
|
@fkatsuhiro when you submit a PR that closes an existing issue, please use github magic comments https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword |
7396e43 to
f46f938
Compare
Oh, I had no idea about it! |
| `vite:dep-scan` intercepted `.astro` files before `astroFrontmatterScanPlugin`, silently skipping frontmatter imports and triggering cascading re-optimization cycles that caused "The file does not exist" crashes in workerd on first request. | ||
|
|
||
| Fixed by adding `onResolve` to claim `.astro` files first, pre-including View Transitions modules in optimizeDeps.include, and enabling `ignoreOutdatedRequests` on server environments. |
There was a problem hiding this comment.
Can you reword the changeset by following these guidelines? https://contribute.docs.astro.build/docs-for-code-changes/changesets/#tips-and-examples
There was a problem hiding this comment.
I've update this.
Could you check this, if you are available? Thank you.
1770753 to
d886b3d
Compare
d886b3d to
e0be125
Compare
Pins @astrojs/cloudflare at 13.5.1; 13.5.2 (PR withastro/astro#16708) broke `astro check`/`astro build` by making esbuild bundle expressive-code's `virtual:` modules. Bumps npm-run-all2 to v9 (now ESM-only, Node engine ^22.22.2 || ^24.15.0) — root is already ESM and CI runs 22/24.
Lifts the 13.5.1 pin from #146. Upstream fix for the expressive-code virtual-module bundling issue shipped in 13.5.3 (withastro/astro#16708 follow-up). Verified `pnpm --filter @nicia-ai/typegraph-docs typecheck` and `build` both succeed. Other bumps (all dev-only): astro 6.3.5 → ^6.3.6, vitest 4.1.6 → ^4.1.7, @vitest/coverage-v8 4.1.6 → ^4.1.7, eslint-plugin-functional 9.0.4 → ^9.0.5.
@astrojs/cloudflare 13.5.2 shipped withastro/astro#16708, which added an esbuild dep-scan plugin that incorrectly tried to bundle virtual: modules imported from .astro frontmatter. astro-expressive-code (pulled in by @astrojs/starlight) imports virtual:astro-expressive-code/{config,api}, so astro build fails with "Could not resolve" errors. Reverted upstream in withastro/astro#16801, released in 13.5.3. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Patrick Linnane <patrick@linnane.io>
…2 updates (#197) * chore(deps): bump the npm-dependencies group across 1 directory with 2 updates Bumps the npm-dependencies group with 2 updates in the /site directory: [@astrojs/cloudflare](https://github.com/withastro/astro/tree/HEAD/packages/integrations/cloudflare) and [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro). Updates `@astrojs/cloudflare` from 13.5.1 to 13.5.2 - [Release notes](https://github.com/withastro/astro/releases) - [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/cloudflare/CHANGELOG.md) - [Commits](https://github.com/withastro/astro/commits/@astrojs/cloudflare@13.5.2/packages/integrations/cloudflare) Updates `astro` from 6.3.3 to 6.3.5 - [Release notes](https://github.com/withastro/astro/releases) - [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md) - [Commits](https://github.com/withastro/astro/commits/astro@6.3.5/packages/astro) --- updated-dependencies: - dependency-name: "@astrojs/cloudflare" dependency-version: 13.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-dependencies - dependency-name: astro dependency-version: 6.3.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * fix(site): bump @astrojs/cloudflare to 13.5.5 to unbreak build @astrojs/cloudflare 13.5.2 shipped withastro/astro#16708, which added an esbuild dep-scan plugin that incorrectly tried to bundle virtual: modules imported from .astro frontmatter. astro-expressive-code (pulled in by @astrojs/starlight) imports virtual:astro-expressive-code/{config,api}, so astro build fails with "Could not resolve" errors. Reverted upstream in withastro/astro#16801, released in 13.5.3. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Patrick Linnane <patrick@linnane.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Patrick Linnane <patrick@linnane.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Linnane <patrick@linnane.io> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Changes
Close #16248
Root cause
Dependencies imported within
.astrofile frontmatter are not detected during Vite's initial Dependency Optimization phase. This leads to several issues.Solution
I have added an
onResolvehandler to theastro-frontmatter-scanplugin to ensure proper dependency discoveryTesting
Before Implemented
After Implemented
Docs