Skip to content

Fix dependency resolution warnings with the Cloudflare adapter - #4250

Merged
HiDeoo merged 2 commits into
withastro:mainfrom
HiDeoo:hd/fix-cloudflare-optimize-deps
Oct 8, 2026
Merged

HiDeoo merged 2 commits into
withastro:mainfrom
HiDeoo:hd/fix-cloudflare-optimize-deps

Conversation

@HiDeoo

@HiDeoo HiDeoo commented Oct 7, 2026

Copy link
Copy Markdown
Member

Description

While reviewing and doing some tests for #4218, I noticed some Failed to resolve dependency warnings being logged when running the development server in projects using the Cloudflare adapter.

These dependencies were actually never dependencies of Expressive Code but of Starlight itself and were removed in #4134. This now causes the warning. I guess these directives were working previously due to pnpm hoisting behavior and Vite does not care about the exact path but if it can resolve the dependency or not.

To test, I ran:

  1. cd packages/starlight
  2. pnpm build && pnpm pack --out /tmp/sl-cloudflare-test.tgz

In a new directory, I then ran the following commands:

  1. pnpm create astro@latest . -- --template starlight --install --no-git
  2. pnpm astro add cloudflare
  3. pnpm add /tmp/sl-cloudflare-test.tgz
  4. pnpm dev

Here is a comparison before and after the changes:

Before After
SCR-20261007-153402@2x SCR-20261007-154011@2x

@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8498182

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

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

@github-actions github-actions Bot added the 🌟 core Changes to Starlight’s main package label Oct 7, 2026
@netlify

netlify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 8498182
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6ac74af2cf57470008650ff9
😎 Deploy Preview https://deploy-preview-4250--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HiDeoo! I’d seen this logging a couple of times in user logs but hadn’t had time to investigate.

Just one query: is it possible these resolutions would still be needed by a user using @astrojs/markdown-remark? Or is it fixed also for those projects now?

@HiDeoo

HiDeoo commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Just one query: is it possible these resolutions would still be needed by a user using @astrojs/markdown-remark? Or is it fixed also for those projects now?

Not as far as I know. We were the ones importing and using these dependencies in some components (<FileTree>, <Steps>, and <Tabs>), no matter the processor being used, and we removed them. Our unified plugins don't use them either.

Just to be sure, I also re-did the same test in a project using both the Cloudflare adapter and the Unified processor and I did not get any optimized dependencies changed. reloading message due to the removal.

If Astro and @astrojs/markdown-remark ever needs pre-bundling of one of these dependencies, Astro would be the place to handle it rather than in Starlight (which only ever worked due to hoisting with the invalid Expressive Code paths that were used).

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, great. Thanks for taking the time confirm that! 🙌

@HiDeoo
HiDeoo merged commit 531af7d into withastro:main Oct 8, 2026
20 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Oct 8, 2026
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Oct 14, 2026
* main: (43 commits)
  Move starlight-ai-actions to community plugins section (withastro#4271)
  docs: Add manuscrio-pdf to community resources (withastro#4257)
  docs: add Starlight Visual Customizer to community tools (withastro#4262)
  docs: rename ask-my-site to ondocs in community plugins (withastro#4256)
  Fix i18n dashboard responsive issues (withastro#4272)
  i18n(ko-KR): update `plugins` (withastro#4270)
  docs: add starlight-ai-chatbot to community plugins (withastro#4255)
  i18n(ja): update authoring-content.mdx (withastro#4267)
  i18n(ja): update i18n.mdx (withastro#4266)
  i18n(ja): update index.mdx (withastro#4265)
  i18n(ja): update reference/plugins.md (withastro#4268)
  i18n(ko-KR): update `plugins` (withastro#4258)
  docs: add starlight-ai-actions to community plugins (withastro#4254)
  docs: add ask-my-site to community plugins (withastro#4253)
  [ci] release (withastro#4235)
  i18n(is): Add Icelandic UI translations (withastro#4252)
  Fix dependency resolution warnings with the Cloudflare adapter (withastro#4250)
  docs: add astro-aeo to community plugins (withastro#4251)
  i18n(ru): update `resources/plugins.mdx` (withastro#4249)
  feat: integrate zizmor (withastro#4011)
  ...
dadezzz pushed a commit to dadezzz/university_notes that referenced this pull request Oct 15, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.42.5` → `0.42.6`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.42.5/0.42.6) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.42.6?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.42.5/0.42.6?slim=true) |

---

### Release Notes

<details>
<summary>withastro/starlight (@&#8203;astrojs/starlight)</summary>

### [`v0.42.6`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0426)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.42.5...@astrojs/starlight@0.42.6)

##### Patch Changes

- [#&#8203;4252](withastro/starlight#4252) [`40a2584`](withastro/starlight@40a2584) Thanks [@&#8203;olafur-andri](https://github.com/olafur-andri)! - Adds Icelandic language support

- [#&#8203;4229](withastro/starlight#4229) [`e4a3d82`](withastro/starlight@e4a3d82) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes a potential issue with icons being cut off in Firefox when pinch-zooming.

- [#&#8203;4226](withastro/starlight#4226) [`fb562dd`](withastro/starlight@fb562dd) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where pages not importing components from `@astrojs/starlight/components` included styles of Starlight components used on other pages.

- [#&#8203;4250](withastro/starlight#4250) [`531af7d`](withastro/starlight@531af7d) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes `Failed to resolve dependency` warnings logged when running the development server in projects using the Cloudflare adapter.

- [#&#8203;4229](withastro/starlight#4229) [`e4a3d82`](withastro/starlight@e4a3d82) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes the `codePen` and `node` icons slightly extending beyond their bounding box.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNDkuMyIsInVwZGF0ZWRJblZlciI6IjQ0LjE0OS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants